7 packages tagged with “uint128”
Provides static methods to support Int128 and UInt128.
Package Description
Provides Int128 and UInt128.
UltimateOrb Base Class Library.
High-performance and memory-efficient tools for binary data manipulation and stream handling.
Library containing a UInt128 class, and extensions to .Net's built in integral data types. The version targeting .Net 4.5 is implemented as a Portable Class Library. The methods in this library were written with speed in mind. UInt128 operations are generally much faster than BigInteger. Includes an IsPrime method for ulong that's pretty fast even for ulong values near MaxValue, as it uses the Miller-Rabin algorithm that's deterministic (not probable) over the range of ulong values.
Builds on type of the ConstTypeArgs.Core library to provide const type arguments that allow you to use type parameters to pass UInt128 values to generics at compile-time. This provides an analog to type specialization in C++, and can be used for scenarios such as: * Static configuration, * Eliminating unnecessary instance constructors, * "Passing" values to type initializers, * And more. Built-in const type arguments include values for 0 to 16 and others. Here's a simple demonstration showing how to define and use const type arguments and domain-specific type arguments: using ConstTypeArgs.UInt128s; // Const type arguments: public readonly struct _8 : K_UInt128<_8> { public static UInt128 Value => 8; } public readonly struct _64_000 : K_UInt128<_64_000> { public static UInt128 Value => 64000; } public abstract class DefaultSize : UInt128<_64_000> { } // Usage: public class Foo<TSize> where TSize : K_UInt128 { public static readonly UInt128 BigArraySize = TSize.Value; // Code to initialize very large arrays. static Foo() { Console.WriteLine($"Big array size is {BigArraySize.Length}"); } } // Elsewhere var foo = new Foo<_8>(); // Outputs "Big array size is 8" foo = new Foo<DefaultSize>(); // Outputs "Big array size is 32"