69 instantiations of UInt128
GenerateDocumentationAndConfigFiles (2)
src\Compilers\Core\Portable\Hashing\XxHash128.cs (2)
129return new UInt128(hash.High64, hash.Low64); 214return new UInt128(current.High64, current.Low64);
Microsoft.CodeAnalysis (2)
Hashing\XxHash128.cs (2)
129return new UInt128(hash.High64, hash.Low64); 214return new UInt128(current.High64, current.Low64);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
XxHash128Tests.cs (2)
51Assert.Equal(new UInt128(test.HashHigh, test.HashLow), XxHash128.HashToUInt128(input, test.Seed)); 129Assert.Equal(new UInt128(test.HashHigh, test.HashLow), hash.GetCurrentHashAsUInt128());
System.IO.Hashing (2)
System\IO\Hashing\XxHash128.cs (2)
125return new UInt128(hash.High64, hash.Low64); 210return new UInt128(current.High64, current.Low64);
System.Private.CoreLib (53)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (1)
189return new UInt128(
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (1)
35value /= new UInt128(0x5, 0x6BC7_5E2D_6310_0000); // value /= 1e20
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (2)
1389var significand = new UInt128(value._hi32, value._lo64); 1622result = (actualValue >= new UInt128(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? MaxValue : (decimal)actualValue;
src\libraries\System.Private.CoreLib\src\System\Int128.cs (2)
428public static explicit operator UInt128(Int128 value) => new UInt128(value._upper, value._lower); 441return new UInt128(value._upper, value._lower);
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
274return new UInt128(high, low);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (1)
2447UInt128 divisor = new UInt128(0, 10_000_000_000_000_000_000);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (45)
502return new UInt128(value.High, value.Low64); 565UInt128 result = new UInt128((bits << 12) >> 1 | 0x8000_0000_0000_0000, 0x0000_0000_0000_0000); 582return new UInt128((ulong)(lower >> 63), (ulong)lower); 595return new UInt128(0, (ushort)value); 604return new UInt128((ulong)(lower >> 63), (ulong)lower); 617return new UInt128(0, (uint)value); 626return new UInt128((ulong)(lower >> 63), (ulong)lower); 639return new UInt128(0, (ulong)value); 648return new UInt128((ulong)(lower >> 63), (ulong)lower); 661return new UInt128(0, (nuint)value); 671return new UInt128((ulong)(lower >> 63), (ulong)lower); 685return new UInt128(0, (byte)value); 706public static implicit operator UInt128(byte value) => new UInt128(0, value); 711public static implicit operator UInt128(char value) => new UInt128(0, value); 717public static implicit operator UInt128(ushort value) => new UInt128(0, value); 723public static implicit operator UInt128(uint value) => new UInt128(0, value); 729public static implicit operator UInt128(ulong value) => new UInt128(0, value); 735public static implicit operator UInt128(nuint value) => new UInt128(0, value); 751return new UInt128(upper, lower); 764return new UInt128(upper, lower); 977static UInt128 IBinaryNumber<UInt128>.AllBitsSet => new UInt128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF); 997public static UInt128 operator &(UInt128 left, UInt128 right) => new UInt128(left._upper & right._upper, left._lower & right._lower); 1000public static UInt128 operator |(UInt128 left, UInt128 right) => new UInt128(left._upper | right._upper, left._lower | right._lower); 1003public static UInt128 operator ^(UInt128 left, UInt128 right) => new UInt128(left._upper ^ right._upper, left._lower ^ right._lower); 1006public static UInt128 operator ~(UInt128 value) => new UInt128(~value._upper, ~value._lower); 1080return new UInt128(highRes, X86Base.X64.DivRem(left._lower, remainder, right._lower).Quotient); 1256return new UInt128( 1320public static UInt128 MinValue => new UInt128(0, 0); 1323public static UInt128 MaxValue => new UInt128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF); 1352return new UInt128(upper, lower); 1386lower = new UInt128(tl._lower, mull._lower); 1437public static UInt128 One => new UInt128(0, 1); 1870short actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x0000_0000_0000_7FFF)) ? short.MaxValue : (short)value; 1876int actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x0000_0000_7FFF_FFFF)) ? int.MaxValue : (int)value; 1882long actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x7FFF_FFFF_FFFF_FFFF)) ? long.MaxValue : (long)value; 1888Int128 actualResult = (value >= new UInt128(0x7FFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? Int128.MaxValue : (Int128)value; 1899nint actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x7FFF_FFFF_FFFF_FFFF)) ? nint.MaxValue : (nint)value; 1906sbyte actualResult = (value >= new UInt128(0x0000_0000_0000_0000, 0x0000_0000_0000_007F)) ? sbyte.MaxValue : (sbyte)value; 2023return new UInt128(upper, 0); 2033return new UInt128(upper, lower); 2059return new UInt128(0, lower); 2069return new UInt128(upper, lower); 2101return new UInt128(upper, lower); 2114return new UInt128(upper, lower); 2168static UInt128 IBinaryIntegerParseAndFormatInfo<UInt128>.MaxValueDiv10 => new UInt128(0x1999_9999_9999_9999, 0x9999_9999_9999_9999);
System.Runtime.Numerics (6)
System\Numerics\BigInteger.cs (6)
1980uu = new UInt128( 2098return new UInt128( 2239else if (x <= new UInt128(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) 2323else if (value <= new UInt128(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) 5036UInt128 bits = new UInt128(upperBits, lowerBits); 5217UInt128 bits = new UInt128(upperBits, lowerBits);
Test.Utilities (2)
src\Compilers\Core\Portable\Hashing\XxHash128.cs (2)
129return new UInt128(hash.High64, hash.Low64); 214return new UInt128(current.High64, current.Low64);
776 references to UInt128
GenerateDocumentationAndConfigFiles (2)
src\Compilers\Core\Portable\Hashing\XxHash128.cs (2)
126public static UInt128 HashToUInt128(ReadOnlySpan<byte> source, long seed = 0) 211public UInt128 GetCurrentHashAsUInt128()
Microsoft.AspNetCore.Components.Endpoints (6)
FormMapping\WellKnownConverters.cs (6)
35{ typeof(UInt128), new ParsableConverter<UInt128>() }, 67converters.Add(typeof(UInt128?), new NullableConverter<UInt128>((FormDataConverter<UInt128>)converters[typeof(UInt128)]));
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Binding\FormDataMapperTests.cs (6)
2117{ "101112", typeof(UInt128?), new UInt128?((UInt128)101112)}, 2159{ typeof(UInt128?) }, 2202{ "101112", typeof(UInt128), (UInt128)101112 },
Microsoft.AspNetCore.Http.Extensions (6)
src\Components\Endpoints\src\FormMapping\WellKnownConverters.cs (6)
35{ typeof(UInt128), new ParsableConverter<UInt128>() }, 67converters.Add(typeof(UInt128?), new NullableConverter<UInt128>((FormDataConverter<UInt128>)converters[typeof(UInt128)]));
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiConstants.cs (1)
45typeof(UInt128),
Microsoft.CodeAnalysis (2)
Hashing\XxHash128.cs (2)
126public static UInt128 HashToUInt128(ReadOnlySpan<byte> source, long seed = 0) 211public UInt128 GetCurrentHashAsUInt128()
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
67yield return new TestData<UInt128>(42, """{"type":"integer"}"""); 1212[JsonSerializable(typeof(UInt128))]
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
67yield return new TestData<UInt128>(42, """{"type":"integer"}"""); 1212[JsonSerializable(typeof(UInt128))]
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
72typeof(T) == typeof(UInt128) ||
System.ComponentModel.TypeConverter (5)
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
166[typeof(UInt128)] = new IntrinsicTypeConverterData((type) => new UInt128Converter()),
System\ComponentModel\UInt128Converter.cs (4)
18internal override Type TargetType => typeof(UInt128); 28return UInt128.Parse(value, NumberStyles.HexNumber); 35UInt128.Parse(value, formatInfo); 41((UInt128)value).ToString(formatInfo);
System.IO.Hashing (2)
System\IO\Hashing\XxHash128.cs (2)
122public static UInt128 HashToUInt128(ReadOnlySpan<byte> source, long seed = 0) 207public UInt128 GetCurrentHashAsUInt128()
System.Linq (11)
System\Linq\Max.cs (4)
335if (typeof(TSource) == typeof(UInt128) && comparer == Comparer<TSource>.Default) return (TSource)(object)MinMaxInteger<UInt128, MaxCalc<UInt128>>((IEnumerable<UInt128>)source);
System\Linq\Min.cs (4)
314if (typeof(TSource) == typeof(UInt128) && comparer == Comparer<TSource>.Default) return (TSource)(object)MinMaxInteger<UInt128, MinCalc<UInt128>>((IEnumerable<UInt128>)source);
System\Linq\OrderBy.cs (1)
161t == typeof(Int128) || t == typeof(UInt128) ||
System\Linq\Sequence.cs (2)
91if (typeof(T) == typeof(ulong) && (range = TryUseRange<UInt128>(start, endInclusive, step, ulong.MaxValue)) is not null) return range; 93if (typeof(T) == typeof(nuint) && (range = TryUseRange<UInt128>(start, endInclusive, step, nuint.MaxValue)) is not null) return range;
System.Net.Primitives (11)
System\Net\IPNetwork.cs (11)
108UInt128 baseAddressValue = default; 109UInt128 otherAddressValue = default; 111BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 113address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 116UInt128 mask = UInt128.MaxValue << (128 - PrefixLength); 263UInt128 value = default; 264baseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref value)), out int bytesWritten); 268return value != UInt128.Zero; 271UInt128 mask = UInt128.MaxValue << (128 - prefixLength);
System.Numerics.Tensors (2)
System\Numerics\Tensors\netcore\TensorPrimitives.IsNegative.cs (1)
67typeof(T) != typeof(UInt128);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (1)
78typeof(T) == typeof(Int128) || typeof(T) == typeof(UInt128) ||
System.Private.CoreLib (646)
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (10)
286public static byte[] GetBytes(UInt128 value) 288byte[] bytes = new byte[UInt128.Size]; 301public static bool TryWriteBytes(Span<byte> destination, UInt128 value) 303if (destination.Length < UInt128.Size) 668public static UInt128 ToUInt128(byte[] value, int startIndex) 674if (startIndex > value.Length - UInt128.Size) 677return Unsafe.ReadUnaligned<UInt128>(ref value[startIndex]); 688public static UInt128 ToUInt128(ReadOnlySpan<byte> value) 690if (value.Length < UInt128.Size) 692return Unsafe.ReadUnaligned<UInt128>(ref MemoryMarshal.GetReference(value));
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadBigEndian.cs (9)
202/// Reads a <see cref="UInt128" /> from the beginning of a read-only span of bytes, as big endian. 208/// <paramref name="source"/> is too small to contain a <see cref="UInt128" />. 212public static UInt128 ReadUInt128BigEndian(ReadOnlySpan<byte> source) 215ReverseEndianness(MemoryMarshal.Read<UInt128>(source)) : 216MemoryMarshal.Read<UInt128>(source); 482/// Reads a <see cref="UInt128" /> from the beginning of a read-only span of bytes, as big endian. 487/// <see langword="true" /> if the span is large enough to contain a <see cref="UInt128" />; otherwise, <see langword="false" />. 492public static bool TryReadUInt128BigEndian(ReadOnlySpan<byte> source, out UInt128 value) 496bool success = MemoryMarshal.TryRead(source, out UInt128 tmp);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadLittleEndian.cs (9)
202/// Reads a <see cref="UInt128" /> from the beginning of a read-only span of bytes, as little endian. 208/// <paramref name="source"/> is too small to contain a <see cref="UInt128" />. 212public static UInt128 ReadUInt128LittleEndian(ReadOnlySpan<byte> source) 215ReverseEndianness(MemoryMarshal.Read<UInt128>(source)) : 216MemoryMarshal.Read<UInt128>(source); 482/// Reads a <see cref="UInt128" /> from the beginning of a read-only span of bytes, as little endian. 487/// <see langword="true" /> if the span is large enough to contain a <see cref="UInt128" />; otherwise, <see langword="false" />. 492public static bool TryReadUInt128LittleEndian(ReadOnlySpan<byte> source, out UInt128 value) 499bool success = MemoryMarshal.TryRead(source, out UInt128 tmp);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (7)
181/// Reverses a primitive value by performing an endianness swap of the specified <see cref="UInt128" /> value. 187public static UInt128 ReverseEndianness(UInt128 value) 375public static void ReverseEndianness(ReadOnlySpan<UInt128> source, Span<UInt128> destination) => 376ReverseEndianness(MemoryMarshal.Cast<UInt128, Int128>(source), MemoryMarshal.Cast<UInt128, Int128>(destination));
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (8)
268/// Writes a <see cref="UInt128" /> into a span of bytes, as big endian. 274/// <paramref name="destination" /> is too small to contain a <see cref="UInt128" />. 278public static void WriteUInt128BigEndian(Span<byte> destination, UInt128 value) 282UInt128 tmp = ReverseEndianness(value); 550/// Writes a <see cref="UInt128" /> into a span of bytes, as big endian. 555/// <see langword="true" /> if the span is large enough to contain a <see cref="UInt128" />; otherwise, <see langword="false" />. 560public static bool TryWriteUInt128BigEndian(Span<byte> destination, UInt128 value) 564UInt128 tmp = ReverseEndianness(value);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (8)
268/// Writes a <see cref="UInt128" /> into a span of bytes, as little endian. 274/// <paramref name="destination" /> is too small to contain a <see cref="UInt128" />. 278public static void WriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 282UInt128 tmp = ReverseEndianness(value); 550/// Writes a <see cref="UInt128" /> into a span of bytes, as little endian. 555/// <see langword="true" /> if the span is large enough to contain a <see cref="UInt128" />; otherwise, <see langword="false" />. 560public static bool TryWriteUInt128LittleEndian(Span<byte> destination, UInt128 value) 564UInt128 tmp = ReverseEndianness(value);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (3)
12public static int CountDigits(UInt128 value) 53public static int CountHexDigits(UInt128 value) 56return ((int)UInt128.Log2(value) >> 2) + 1;
src\libraries\System.Private.CoreLib\src\System\Byte.cs (9)
731else if (typeof(TOther) == typeof(UInt128)) 733UInt128 actualValue = (UInt128)(object)value; 798else if (typeof(TOther) == typeof(UInt128)) 800UInt128 actualValue = (UInt128)(object)value; 865else if (typeof(TOther) == typeof(UInt128)) 867UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\Char.cs (9)
1585else if (typeof(TOther) == typeof(UInt128)) 1587UInt128 actualValue = (UInt128)(object)value; 1648else if (typeof(TOther) == typeof(UInt128)) 1650UInt128 actualValue = (UInt128)(object)value; 1711else if (typeof(TOther) == typeof(UInt128)) 1713UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (7)
1389var significand = new UInt128(value._hi32, value._lo64); 1543else if (typeof(TOther) == typeof(UInt128)) 1545UInt128 actualValue = (UInt128)(object)value; 1619else if (typeof(TOther) == typeof(UInt128)) 1621UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\Double.cs (6)
1346else if (typeof(TOther) == typeof(UInt128)) 1348UInt128 actualResult = checked((UInt128)value); 1444else if (typeof(TOther) == typeof(UInt128)) 1446UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Half.cs (15)
945/// <summary>Explicitly converts a half-precision floating-point value to its nearest representable <see cref="UInt128"/>.</summary> 949public static explicit operator UInt128(Half value) => (UInt128)(double)(value); 951/// <summary>Explicitly converts a half-precision floating-point value to its nearest representable <see cref="UInt128"/>, throwing an overflow exception for any values that fall outside the representable range.</summary> 954/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 956public static explicit operator checked UInt128(Half value) => checked((UInt128)(double)(value)); 2048else if (typeof(TOther) == typeof(UInt128)) 2050UInt128 actualResult = checked((UInt128)value); 2146else if (typeof(TOther) == typeof(UInt128)) 2148UInt128 actualResult = (value == PositiveInfinity) ? UInt128.MaxValue : 2149(value <= Zero) ? UInt128.MinValue : (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Int128.cs (36)
223return -(decimal)(UInt128)(value); 225return (decimal)(UInt128)(value); 236return -(double)(UInt128)(value); 238return (double)(UInt128)(value); 249return -(Half)(UInt128)(value); 251return (Half)(UInt128)(value); 359return -(float)(UInt128)(value); 361return (float)(UInt128)(value); 424/// <summary>Explicitly converts a 128-bit signed integer to a <see cref="UInt128" /> value.</summary> 426/// <returns><paramref name="value" /> converted to a <see cref="UInt128" />.</returns> 428public static explicit operator UInt128(Int128 value) => new UInt128(value._upper, value._lower); 430/// <summary>Explicitly converts a 128-bit signed integer to a <see cref="UInt128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary> 432/// <returns><paramref name="value" /> converted to a <see cref="UInt128" />.</returns> 435public static explicit operator checked UInt128(Int128 value) 1082UInt128 result = (UInt128)(left) / (UInt128)(right); 1154return (Int128)((UInt128)(left) * (UInt128)(right)); 1187UInt128 upper = UInt128.BigMul((UInt128)(left), (UInt128)(right), out UInt128 ulower); 1756else if (typeof(TOther) == typeof(UInt128)) 1758UInt128 actualResult = checked((UInt128)value); 1830else if (typeof(TOther) == typeof(UInt128)) 1832UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1900else if (typeof(TOther) == typeof(UInt128)) 1902UInt128 actualResult = (UInt128)value; 2137static bool IBinaryIntegerParseAndFormatInfo<Int128>.IsGreaterThanAsUnsigned(Int128 left, Int128 right) => (UInt128)(left) > (UInt128)(right);
src\libraries\System.Private.CoreLib\src\System\Int16.cs (10)
1147else if (typeof(TOther) == typeof(UInt128)) 1149UInt128 actualResult = checked((UInt128)value); 1216else if (typeof(TOther) == typeof(UInt128)) 1218UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1284else if (typeof(TOther) == typeof(UInt128)) 1286UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Int32.cs (10)
1211else if (typeof(TOther) == typeof(UInt128)) 1213UInt128 actualResult = checked((UInt128)value); 1282else if (typeof(TOther) == typeof(UInt128)) 1284UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1350else if (typeof(TOther) == typeof(UInt128)) 1352UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Int64.cs (10)
1206else if (typeof(TOther) == typeof(UInt128)) 1208UInt128 actualResult = checked((UInt128)value); 1278else if (typeof(TOther) == typeof(UInt128)) 1280UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1353else if (typeof(TOther) == typeof(UInt128)) 1355UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (10)
1202else if (typeof(TOther) == typeof(UInt128)) 1204UInt128 actualResult = checked((UInt128)value); 1274else if (typeof(TOther) == typeof(UInt128)) 1276UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1342else if (typeof(TOther) == typeof(UInt128)) 1344UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
271public static UInt128 BigMul(ulong a, ulong b)
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (38)
1107? UInt128ToDecStr((UInt128)value, digits: -1) 1123? UInt128ToDecStr((UInt128)value, digits) 1170? TryUInt128ToDecStr((UInt128)value, digits: -1, destination, out charsWritten) 1184? TryUInt128ToDecStr((UInt128)value, digits, destination, out charsWritten) 1223public static string FormatUInt128(UInt128 value, string? format, IFormatProvider? provider) 1233static unsafe string FormatUInt128Slow(UInt128 value, string? format, IFormatProvider? provider) 1280public static bool TryFormatUInt128<TChar>(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar> 1292static unsafe bool TryFormatUInt128Slow(UInt128 value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) 2210byte* p = UInt128ToDecChars(buffer + Int128Precision, (UInt128)value, 0); 2230? UInt128ToDecStr((UInt128)value, -1) 2243UInt128 absValue = (UInt128)(-value); 2271UInt128 absValue = (UInt128)(-value); 2302UInt128 uValue = (UInt128)value; 2323UInt128 uValue = (UInt128)value; 2342private static unsafe TChar* Int128ToHexChars<TChar>(TChar* buffer, UInt128 value, int hexBase, int digits) where TChar : unmanaged, IUtfChar<TChar> 2365UInt128 uValue = (UInt128)value; 2367int bufferLength = Math.Max(digits, 128 - (int)UInt128.LeadingZeroCount((UInt128)value)); 2386UInt128 uValue = (UInt128)value; 2388int bufferLength = Math.Max(digits, 128 - (int)UInt128.LeadingZeroCount((UInt128)value)); 2405private static unsafe TChar* UInt128ToBinaryChars<TChar>(TChar* buffer, UInt128 value, int digits) where TChar : unmanaged, IUtfChar<TChar> 2421private static unsafe void UInt128ToNumber(UInt128 value, ref NumberBuffer number) 2445private static ulong Int128DivMod1E19(ref UInt128 value) 2447UInt128 divisor = new UInt128(0, 10_000_000_000_000_000_000); 2448(value, UInt128 remainder) = UInt128.DivRem(value, divisor); 2453internal static unsafe TChar* UInt128ToDecChars<TChar>(TChar* bufferEnd, UInt128 value) where TChar : unmanaged, IUtfChar<TChar> 2465internal static unsafe TChar* UInt128ToDecChars<TChar>(TChar* bufferEnd, UInt128 value, int digits) where TChar : unmanaged, IUtfChar<TChar> 2477internal static unsafe string UInt128ToDecStr(UInt128 value) 2496internal static unsafe string UInt128ToDecStr(UInt128 value, int digits) 2514private static unsafe bool TryUInt128ToDecStr<TChar>(UInt128 value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (24)
421/// <summary>Explicitly converts a native-sized floating-point value to its nearest representable <see cref="UInt128" /> value.</summary> 423/// <returns><paramref name="value" /> converted to its nearest representable <see cref="UInt128" /> value.</returns> 426public static explicit operator UInt128(NFloat value) => (UInt128)(value._value); 428/// <summary>Explicitly converts a native-sized floating-point value to its nearest representable <see cref="UInt128" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary> 430/// <returns><paramref name="value" /> converted to its nearest representable <see cref="UInt128" /> value.</returns> 431/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 434public static explicit operator checked UInt128(NFloat value) => checked((UInt128)(value._value)); 500return -(NFloat)(UInt128)(value); 502return (NFloat)(UInt128)(value); 545/// <summary>Explicitly converts <see cref="UInt128"/> to its nearest representable native-sized floating-point value.</summary> 550public static explicit operator NFloat(UInt128 value) => (NFloat)(double)(value); 1507else if (typeof(TOther) == typeof(UInt128)) 1509UInt128 actualValue = (UInt128)(object)value; 1620else if (typeof(TOther) == typeof(UInt128)) 1622UInt128 actualResult = checked((UInt128)value); 1761else if (typeof(TOther) == typeof(UInt128)) 1763UInt128 actualResult = (value >= 340282366920938463463374607431768211455.0) ? UInt128.MaxValue : 1764(value <= 0.0) ? UInt128.MinValue : (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\SByte.cs (10)
1111else if (typeof(TOther) == typeof(UInt128)) 1113UInt128 actualResult = checked((UInt128)value); 1179else if (typeof(TOther) == typeof(UInt128)) 1181UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1247else if (typeof(TOther) == typeof(UInt128)) 1249UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Single.cs (6)
1365else if (typeof(TOther) == typeof(UInt128)) 1367UInt128 actualResult = checked((UInt128)value); 1463else if (typeof(TOther) == typeof(UInt128)) 1465UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
5428(sizeof(TResult) == sizeof(UInt128) && *(UInt128*)&result == default))
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (352)
20: IBinaryInteger<UInt128>, 21IMinMaxValue<UInt128>, 22IUnsignedNumber<UInt128>, 24IBinaryIntegerParseAndFormatInfo<UInt128> 36/// <summary>Initializes a new instance of the <see cref="UInt128" /> struct.</summary> 53if (value is UInt128 other) 68public int CompareTo(UInt128 value) 87return (obj is UInt128 other) && Equals(other); 91public bool Equals(UInt128 other) 131public static UInt128 Parse(string s) => Parse(s, NumberStyles.Integer, provider: null); 133public static UInt128 Parse(string s, NumberStyles style) => Parse(s, style, provider: null); 135public static UInt128 Parse(string s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider); 137public static UInt128 Parse(string s, NumberStyles style, IFormatProvider? provider) 143public static UInt128 Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) 146return Number.ParseBinaryInteger<char, UInt128>(s, style, NumberFormatInfo.GetInstance(provider)); 149public static bool TryParse([NotNullWhen(true)] string? s, out UInt128 result) => TryParse(s, NumberStyles.Integer, provider: null, out result); 151public static bool TryParse(ReadOnlySpan<char> s, out UInt128 result) => TryParse(s, NumberStyles.Integer, provider: null, out result); 157public static bool TryParse(ReadOnlySpan<byte> utf8Text, out UInt128 result) => TryParse(utf8Text, NumberStyles.Integer, provider: null, out result); 159public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out UInt128 result) 171public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out UInt128 result) 184public static explicit operator byte(UInt128 value) => (byte)value._lower; 189/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 190public static explicit operator checked byte(UInt128 value) 202public static explicit operator char(UInt128 value) => (char)value._lower; 207/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 208public static explicit operator checked char(UInt128 value) 220public static explicit operator decimal(UInt128 value) 238public static explicit operator double(UInt128 value) 288public static explicit operator Half(UInt128 value) => (Half)(double)(value); 293public static explicit operator short(UInt128 value) => (short)value._lower; 298/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 299public static explicit operator checked short(UInt128 value) 311public static explicit operator int(UInt128 value) => (int)value._lower; 316/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 317public static explicit operator checked int(UInt128 value) 329public static explicit operator long(UInt128 value) => (long)value._lower; 334/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 335public static explicit operator checked long(UInt128 value) 348public static explicit operator Int128(UInt128 value) => new Int128(value._upper, value._lower); 353/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 355public static explicit operator checked Int128(UInt128 value) 367public static explicit operator nint(UInt128 value) => (nint)value._lower; 372/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 373public static explicit operator checked nint(UInt128 value) 386public static explicit operator sbyte(UInt128 value) => (sbyte)value._lower; 391/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 393public static explicit operator checked sbyte(UInt128 value) 405public static explicit operator float(UInt128 value) => (float)(double)(value); 411public static explicit operator ushort(UInt128 value) => (ushort)value._lower; 416/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 418public static explicit operator checked ushort(UInt128 value) 431public static explicit operator uint(UInt128 value) => (uint)value._lower; 436/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 438public static explicit operator checked uint(UInt128 value) 451public static explicit operator ulong(UInt128 value) => value._lower; 456/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 458public static explicit operator checked ulong(UInt128 value) 471public static explicit operator nuint(UInt128 value) => (nuint)value._lower; 476/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 478public static explicit operator checked nuint(UInt128 value) 494public static explicit operator UInt128(decimal value) 508public static explicit operator UInt128(double value) 527/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 528public static explicit operator checked UInt128(double value) 543internal static UInt128 ToUInt128(double value) 565UInt128 result = new UInt128((bits << 12) >> 1 | 0x8000_0000_0000_0000, 0x0000_0000_0000_0000); 579public static explicit operator UInt128(short value) 588/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 589public static explicit operator checked UInt128(short value) 601public static explicit operator UInt128(int value) 610/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 611public static explicit operator checked UInt128(int value) 623public static explicit operator UInt128(long value) 632/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 633public static explicit operator checked UInt128(long value) 645public static explicit operator UInt128(nint value) 654/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 655public static explicit operator checked UInt128(nint value) 668public static explicit operator UInt128(sbyte value) 677/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 679public static explicit operator checked UInt128(sbyte value) 691public static explicit operator UInt128(float value) => (UInt128)(double)(value); 696/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="UInt128" />.</exception> 697public static explicit operator checked UInt128(float value) => checked((UInt128)(double)(value)); 706public static implicit operator UInt128(byte value) => new UInt128(0, value); 711public static implicit operator UInt128(char value) => new UInt128(0, value); 717public static implicit operator UInt128(ushort value) => new UInt128(0, value); 723public static implicit operator UInt128(uint value) => new UInt128(0, value); 729public static implicit operator UInt128(ulong value) => new UInt128(0, value); 735public static implicit operator UInt128(nuint value) => new UInt128(0, value); 742public static UInt128 operator +(UInt128 left, UInt128 right) 755public static UInt128 operator checked +(UInt128 left, UInt128 right) 772static UInt128 IAdditiveIdentity<UInt128, UInt128>.AdditiveIdentity => default; 779public static (UInt128 Quotient, UInt128 Remainder) DivRem(UInt128 left, UInt128 right) 781UInt128 quotient = left / right; 786public static UInt128 LeadingZeroCount(UInt128 value) 791private static int LeadingZeroCountAsInt32(UInt128 value) 801public static UInt128 PopCount(UInt128 value) 805public static UInt128 RotateLeft(UInt128 value, int rotateAmount) 809public static UInt128 RotateRight(UInt128 value, int rotateAmount) 813public static UInt128 TrailingZeroCount(UInt128 value) 823static bool IBinaryInteger<UInt128>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out UInt128 value) 825UInt128 result = default; 854result = Unsafe.ReadUnaligned<UInt128>(ref sourceRef); 880static bool IBinaryInteger<UInt128>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out UInt128 value) 882UInt128 result = default; 909result = Unsafe.ReadUnaligned<UInt128>(ref sourceRef); 926UInt128 part = Unsafe.Add(ref sourceRef, i); 938int IBinaryInteger<UInt128>.GetShortestBitLength() 944int IBinaryInteger<UInt128>.GetByteCount() => Size; 947bool IBinaryInteger<UInt128>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 960bool IBinaryInteger<UInt128>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 977static UInt128 IBinaryNumber<UInt128>.AllBitsSet => new UInt128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF); 980public static bool IsPow2(UInt128 value) => PopCount(value) == 1U; 983public static UInt128 Log2(UInt128 value) 997public static UInt128 operator &(UInt128 left, UInt128 right) => new UInt128(left._upper & right._upper, left._lower & right._lower); 1000public static UInt128 operator |(UInt128 left, UInt128 right) => new UInt128(left._upper | right._upper, left._lower | right._lower); 1003public static UInt128 operator ^(UInt128 left, UInt128 right) => new UInt128(left._upper ^ right._upper, left._lower ^ right._lower); 1006public static UInt128 operator ~(UInt128 value) => new UInt128(~value._upper, ~value._lower); 1013public static bool operator <(UInt128 left, UInt128 right) 1020public static bool operator <=(UInt128 left, UInt128 right) 1027public static bool operator >(UInt128 left, UInt128 right) 1034public static bool operator >=(UInt128 left, UInt128 right) 1045public static UInt128 operator --(UInt128 value) => value - One; 1048public static UInt128 operator checked --(UInt128 value) => checked(value - One); 1055public static UInt128 operator /(UInt128 left, UInt128 right) 1130unsafe static UInt128 DivideSlow(UInt128 quotient, UInt128 divisor) 1293public static UInt128 operator checked /(UInt128 left, UInt128 right) => left / right; 1300public static bool operator ==(UInt128 left, UInt128 right) => (left._lower == right._lower) && (left._upper == right._upper); 1303public static bool operator !=(UInt128 left, UInt128 right) => (left._lower != right._lower) || (left._upper != right._upper); 1310public static UInt128 operator ++(UInt128 value) => value + One; 1313public static UInt128 operator checked ++(UInt128 value) => checked(value + One); 1320public static UInt128 MinValue => new UInt128(0, 0); 1323public static UInt128 MaxValue => new UInt128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF); 1330public static UInt128 operator %(UInt128 left, UInt128 right) 1332UInt128 quotient = left / right; 1341static UInt128 IMultiplicativeIdentity<UInt128, UInt128>.MultiplicativeIdentity => One; 1348public static UInt128 operator *(UInt128 left, UInt128 right) 1356public static UInt128 operator checked *(UInt128 left, UInt128 right) 1358UInt128 upper = BigMul(left, right, out UInt128 lower); 1368internal static UInt128 BigMul(UInt128 left, UInt128 right, out UInt128 lower) 1382UInt128 mull = Math.BigMul(al, bl); 1383UInt128 t = Math.BigMul(ah, bl) + mull._upper; 1384UInt128 tl = Math.BigMul(al, bh) + t._lower; 1395public static UInt128 Clamp(UInt128 value, UInt128 min, UInt128 max) 1415static UInt128 INumber<UInt128>.CopySign(UInt128 value, UInt128 sign) => value; 1418public static UInt128 Max(UInt128 x, UInt128 y) => (x >= y) ? x : y; 1421static UInt128 INumber<UInt128>.MaxNumber(UInt128 x, UInt128 y) => Max(x, y); 1424public static UInt128 Min(UInt128 x, UInt128 y) => (x <= y) ? x : y; 1427static UInt128 INumber<UInt128>.MinNumber(UInt128 x, UInt128 y) => Min(x, y); 1430public static int Sign(UInt128 value) => (value == 0U) ? 0 : 1; 1437public static UInt128 One => new UInt128(0, 1); 1440static int INumberBase<UInt128>.Radix => 2; 1443public static UInt128 Zero => default; 1446static UInt128 INumberBase<UInt128>.Abs(UInt128 value) => value; 1450public static UInt128 CreateChecked<TOther>(TOther value) 1453UInt128 result; 1455if (typeof(TOther) == typeof(UInt128)) 1457result = (UInt128)(object)value; 1469public static UInt128 CreateSaturating<TOther>(TOther value) 1472UInt128 result; 1474if (typeof(TOther) == typeof(UInt128)) 1476result = (UInt128)(object)value; 1488public static UInt128 CreateTruncating<TOther>(TOther value) 1491UInt128 result; 1493if (typeof(TOther) == typeof(UInt128)) 1495result = (UInt128)(object)value; 1506static bool INumberBase<UInt128>.IsCanonical(UInt128 value) => true; 1509static bool INumberBase<UInt128>.IsComplexNumber(UInt128 value) => false; 1512public static bool IsEvenInteger(UInt128 value) => (value._lower & 1) == 0; 1515static bool INumberBase<UInt128>.IsFinite(UInt128 value) => true; 1518static bool INumberBase<UInt128>.IsImaginaryNumber(UInt128 value) => false; 1521static bool INumberBase<UInt128>.IsInfinity(UInt128 value) => false; 1524static bool INumberBase<UInt128>.IsInteger(UInt128 value) => true; 1527static bool INumberBase<UInt128>.IsNaN(UInt128 value) => false; 1530static bool INumberBase<UInt128>.IsNegative(UInt128 value) => false; 1533static bool INumberBase<UInt128>.IsNegativeInfinity(UInt128 value) => false; 1536static bool INumberBase<UInt128>.IsNormal(UInt128 value) => value != 0U; 1539public static bool IsOddInteger(UInt128 value) => (value._lower & 1) != 0; 1542static bool INumberBase<UInt128>.IsPositive(UInt128 value) => true; 1545static bool INumberBase<UInt128>.IsPositiveInfinity(UInt128 value) => false; 1548static bool INumberBase<UInt128>.IsRealNumber(UInt128 value) => true; 1551static bool INumberBase<UInt128>.IsSubnormal(UInt128 value) => false; 1554static bool INumberBase<UInt128>.IsZero(UInt128 value) => (value == 0U); 1557static UInt128 INumberBase<UInt128>.MaxMagnitude(UInt128 x, UInt128 y) => Max(x, y); 1560static UInt128 INumberBase<UInt128>.MaxMagnitudeNumber(UInt128 x, UInt128 y) => Max(x, y); 1563static UInt128 INumberBase<UInt128>.MinMagnitude(UInt128 x, UInt128 y) => Min(x, y); 1566static UInt128 INumberBase<UInt128>.MinMagnitudeNumber(UInt128 x, UInt128 y) => Min(x, y); 1569static UInt128 INumberBase<UInt128>.MultiplyAddEstimate(UInt128 left, UInt128 right, UInt128 addend) => (left * right) + addend; 1573static bool INumberBase<UInt128>.TryConvertFromChecked<TOther>(TOther value, out UInt128 result) => TryConvertFromChecked(value, out result); 1576private static bool TryConvertFromChecked<TOther>(TOther value, out UInt128 result) 1603result = checked((UInt128)actualValue); 1639static bool INumberBase<UInt128>.TryConvertFromSaturating<TOther>(TOther value, out UInt128 result) => TryConvertFromSaturating(value, out result); 1642private static bool TryConvertFromSaturating<TOther>(TOther value, out UInt128 result) 1669result = (actualValue < 0) ? MinValue : (UInt128)actualValue; 1705static bool INumberBase<UInt128>.TryConvertFromTruncating<TOther>(TOther value, out UInt128 result) => TryConvertFromTruncating(value, out result); 1708private static bool TryConvertFromTruncating<TOther>(TOther value, out UInt128 result) 1735result = (actualValue < 0) ? MinValue : (UInt128)actualValue; 1771static bool INumberBase<UInt128>.TryConvertToChecked<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result) 1845static bool INumberBase<UInt128>.TryConvertToSaturating<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result) 1925static bool INumberBase<UInt128>.TryConvertToTruncating<TOther>(UInt128 value, [MaybeNullWhen(false)] out TOther result) 2002public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out UInt128 result) => TryParse(s, NumberStyles.Integer, provider, out result); 2009public static UInt128 operator <<(UInt128 value, int shiftAmount) 2042public static UInt128 operator >>(UInt128 value, int shiftAmount) => value >>> shiftAmount; 2045public static UInt128 operator >>>(UInt128 value, int shiftAmount) 2082public static UInt128 Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider); 2085public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out UInt128 result) => TryParse(s, NumberStyles.Integer, provider, out result); 2092public static UInt128 operator -(UInt128 left, UInt128 right) 2105public static UInt128 operator checked -(UInt128 left, UInt128 right) 2122public static UInt128 operator -(UInt128 value) => Zero - value; 2125public static UInt128 operator checked -(UInt128 value) => checked(Zero - value); 2132public static UInt128 operator +(UInt128 value) => value; 2139public static UInt128 Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) 2142return Number.ParseBinaryInteger<byte, UInt128>(utf8Text, style, NumberFormatInfo.GetInstance(provider)); 2146public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out UInt128 result) 2153public static UInt128 Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Integer, provider); 2156public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out UInt128 result) => TryParse(utf8Text, NumberStyles.Integer, provider, out result); 2162static bool IBinaryIntegerParseAndFormatInfo<UInt128>.IsSigned => false; 2164static int IBinaryIntegerParseAndFormatInfo<UInt128>.MaxDigitCount => 39; // 340_282_366_920_938_463_463_374_607_431_768_211_455 2166static int IBinaryIntegerParseAndFormatInfo<UInt128>.MaxHexDigitCount => 32; // 0xFFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF 2168static UInt128 IBinaryIntegerParseAndFormatInfo<UInt128>.MaxValueDiv10 => new UInt128(0x1999_9999_9999_9999, 0x9999_9999_9999_9999); 2170static string IBinaryIntegerParseAndFormatInfo<UInt128>.OverflowMessage => SR.Overflow_UInt128; 2172static bool IBinaryIntegerParseAndFormatInfo<UInt128>.IsGreaterThanAsUnsigned(UInt128 left, UInt128 right) => left > right; 2174static UInt128 IBinaryIntegerParseAndFormatInfo<UInt128>.MultiplyBy10(UInt128 value) => value * 10; 2176static UInt128 IBinaryIntegerParseAndFormatInfo<UInt128>.MultiplyBy16(UInt128 value) => value * 16;
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (9)
750else if (typeof(TOther) == typeof(UInt128)) 752UInt128 actualValue = (UInt128)(object)value; 817else if (typeof(TOther) == typeof(UInt128)) 819UInt128 actualValue = (UInt128)(object)value; 884else if (typeof(TOther) == typeof(UInt128)) 886UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (9)
789else if (typeof(TOther) == typeof(UInt128)) 791UInt128 actualValue = (UInt128)(object)value; 856else if (typeof(TOther) == typeof(UInt128)) 858UInt128 actualValue = (UInt128)(object)value; 923else if (typeof(TOther) == typeof(UInt128)) 925UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (10)
51public static UInt128 BigMul(ulong left, ulong right) => Math.BigMul(left, right); 788else if (typeof(TOther) == typeof(UInt128)) 790UInt128 actualValue = (UInt128)(object)value; 855else if (typeof(TOther) == typeof(UInt128)) 857UInt128 actualValue = (UInt128)(object)value; 922else if (typeof(TOther) == typeof(UInt128)) 924UInt128 actualValue = (UInt128)(object)value;
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (9)
797else if (typeof(TOther) == typeof(UInt128)) 799UInt128 actualValue = (UInt128)(object)value; 864else if (typeof(TOther) == typeof(UInt128)) 866UInt128 actualValue = (UInt128)(object)value; 931else if (typeof(TOther) == typeof(UInt128)) 933UInt128 actualValue = (UInt128)(object)value;
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
867[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.UInt128))]
System.Runtime.Numerics (51)
System\Numerics\BigInteger.cs (33)
1976UInt128 uu; 2076/// <summary>Explicitly converts a big integer to a <see cref="UInt128" /> value.</summary> 2078/// <returns><paramref name="value" /> converted to <see cref="UInt128" /> value.</returns> 2080public static explicit operator UInt128(BigInteger value) 2086return checked((UInt128)value._sign); 2216UInt128 x; 2219x = unchecked((UInt128)(-value)); 2224x = (UInt128)value; 2298/// <summary>Implicitly converts a <see cref="UInt128" /> value to a big integer.</summary> 2302public static implicit operator BigInteger(UInt128 value) 4311else if (typeof(TOther) == typeof(UInt128)) 4313UInt128 actualValue = (UInt128)(object)value; 4428else if (typeof(TOther) == typeof(UInt128)) 4430UInt128 actualValue = (UInt128)(object)value; 4545else if (typeof(TOther) == typeof(UInt128)) 4547UInt128 actualValue = (UInt128)(object)value; 4664else if (typeof(TOther) == typeof(UInt128)) 4666UInt128 actualResult = checked((UInt128)value); 4855else if (typeof(TOther) == typeof(UInt128)) 4857UInt128 actualResult = (value >= UInt128.MaxValue) ? UInt128.MaxValue : 4858IsNegative(value) ? UInt128.MinValue : (UInt128)value; 5036UInt128 bits = new UInt128(upperBits, lowerBits); 5189else if (typeof(TOther) == typeof(UInt128)) 5191UInt128 actualResult; 5217UInt128 bits = new UInt128(upperBits, lowerBits); 5228actualResult = (UInt128)value._sign;
System\Numerics\Complex.cs (18)
796/// <summary>Explicitly converts a <see cref="UInt128" /> value to a double-precision complex number.</summary> 800public static explicit operator Complex(UInt128 value) 1591else if (typeof(TOther) == typeof(UInt128)) 1593UInt128 actualValue = (UInt128)(object)value; 1780else if (typeof(TOther) == typeof(UInt128)) 1787UInt128 actualResult = checked((UInt128)value.m_real); 1932else if (typeof(TOther) == typeof(UInt128)) 1934UInt128 actualResult = (value.m_real >= 340282366920938463463374607431768211455.0) ? UInt128.MaxValue : 1935(value.m_real <= 0.0) ? UInt128.MinValue : (UInt128)value.m_real; 2068else if (typeof(TOther) == typeof(UInt128)) 2070UInt128 actualResult = (value.m_real >= 340282366920938463463374607431768211455.0) ? UInt128.MaxValue : 2071(value.m_real <= 0.0) ? UInt128.MinValue : (UInt128)value.m_real;
System.Text.Json (17)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
102if (type == typeof(Half) || type == typeof(UInt128) || type == typeof(Int128))
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (12)
12internal sealed class UInt128Converter : JsonPrimitiveConverter<UInt128> 21public override UInt128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 31public override void Write(Utf8JsonWriter writer, UInt128 value, JsonSerializerOptions options) 36private static UInt128 ReadCore(ref Utf8JsonReader reader) 46if (!UInt128.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out UInt128 result)) 59private static void WriteCore(Utf8JsonWriter writer, UInt128 value) 66internal override UInt128 ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 72internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, UInt128 value, JsonSerializerOptions options, bool isWritingExtensionDataProperty) 79internal override UInt128 ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options) 90internal override void WriteNumberWithCustomHandling(Utf8JsonWriter writer, UInt128 value, JsonNumberHandling handling) 114UInt128 value, out int written)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
120/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="UInt128"/> values. 124public static JsonConverter<UInt128> UInt128Converter => s_uint128Converter ??= new UInt128Converter(); 125private static JsonConverter<UInt128>? s_uint128Converter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
731potentialNumberType == typeof(UInt128) ||
Test.Utilities (2)
src\Compilers\Core\Portable\Hashing\XxHash128.cs (2)
126public static UInt128 HashToUInt128(ReadOnlySpan<byte> source, long seed = 0) 211public UInt128 GetCurrentHashAsUInt128()