20 instantiations of UInt128
Microsoft.CodeAnalysis (2)
Hashing\XxHash128.cs (2)
129return new UInt128(hash.High64, hash.Low64); 214return new UInt128(current.High64, current.Low64);
Microsoft.CodeAnalysis.Workspaces (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.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 (6)
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\Math.cs (1)
284return 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);
System.Runtime.Numerics (6)
System\Numerics\BigInteger.cs (6)
1953uu = new UInt128( 2071return new UInt128( 2212else if (x <= new UInt128(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) 2296else if (value <= new UInt128(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) 5009UInt128 bits = new UInt128(upperBits, lowerBits); 5190UInt128 bits = new UInt128(upperBits, lowerBits);
416 references to UInt128
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.CodeAnalysis.Workspaces (2)
src\Compilers\Core\Portable\Hashing\XxHash128.cs (2)
126public static UInt128 HashToUInt128(ReadOnlySpan<byte> source, long seed = 0) 211public UInt128 GetCurrentHashAsUInt128()
Microsoft.Extensions.AI.Abstractions (1)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (1)
598[typeof(UInt128)] = numberHandling => GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling),
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 (1)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
598[typeof(UInt128)] = numberHandling => GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling),
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 (9)
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.Net.Primitives (11)
System\Net\IPNetwork.cs (11)
110UInt128 baseAddressValue = default; 111UInt128 otherAddressValue = default; 113BaseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref baseAddressValue)), out int bytesWritten); 115address.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref otherAddressValue)), out bytesWritten); 118UInt128 mask = UInt128.MaxValue << (128 - PrefixLength); 265UInt128 value = default; 266baseAddress.TryWriteBytes(MemoryMarshal.AsBytes(new Span<UInt128>(ref value)), out int bytesWritten); 270return value != UInt128.Zero; 273UInt128 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 (288)
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)
1552else if (typeof(TOther) == typeof(UInt128)) 1554UInt128 actualValue = (UInt128)(object)value; 1615else if (typeof(TOther) == typeof(UInt128)) 1617UInt128 actualValue = (UInt128)(object)value; 1678else if (typeof(TOther) == typeof(UInt128)) 1680UInt128 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 (8)
1346else if (typeof(TOther) == typeof(UInt128)) 1348UInt128 actualResult = checked((UInt128)value); 1436else if (typeof(TOther) == typeof(UInt128)) 1438UInt128 actualResult = (value >= 340282366920938463463374607431768211455.0) ? UInt128.MaxValue : 1439(value <= 0.0) ? UInt128.MinValue : (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); 2138else if (typeof(TOther) == typeof(UInt128)) 2140UInt128 actualResult = (value == PositiveInfinity) ? UInt128.MaxValue : 2141(value <= Zero) ? UInt128.MinValue : (UInt128)value;
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)
1187else if (typeof(TOther) == typeof(UInt128)) 1189UInt128 actualResult = checked((UInt128)value); 1258else if (typeof(TOther) == typeof(UInt128)) 1260UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1326else if (typeof(TOther) == typeof(UInt128)) 1328UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Int64.cs (10)
1182else if (typeof(TOther) == typeof(UInt128)) 1184UInt128 actualResult = checked((UInt128)value); 1254else if (typeof(TOther) == typeof(UInt128)) 1256UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1329else if (typeof(TOther) == typeof(UInt128)) 1331UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (10)
1178else if (typeof(TOther) == typeof(UInt128)) 1180UInt128 actualResult = checked((UInt128)value); 1250else if (typeof(TOther) == typeof(UInt128)) 1252UInt128 actualResult = (value <= 0) ? UInt128.MinValue : (UInt128)value; 1318else if (typeof(TOther) == typeof(UInt128)) 1320UInt128 actualResult = (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
281public 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 (8)
1365else if (typeof(TOther) == typeof(UInt128)) 1367UInt128 actualResult = checked((UInt128)value); 1455else if (typeof(TOther) == typeof(UInt128)) 1457UInt128 actualResult = (value == PositiveInfinity) ? UInt128.MaxValue : 1458(value <= 0.0f) ? UInt128.MinValue : (UInt128)value;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
5427(sizeof(TResult) == sizeof(UInt128) && *(UInt128*)&result == default))
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (26)
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)
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)
865[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.UInt128))]
System.Runtime.Numerics (51)
System\Numerics\BigInteger.cs (33)
1949UInt128 uu; 2049/// <summary>Explicitly converts a big integer to a <see cref="UInt128" /> value.</summary> 2051/// <returns><paramref name="value" /> converted to <see cref="UInt128" /> value.</returns> 2053public static explicit operator UInt128(BigInteger value) 2059return checked((UInt128)value._sign); 2189UInt128 x; 2192x = unchecked((UInt128)(-value)); 2197x = (UInt128)value; 2271/// <summary>Implicitly converts a <see cref="UInt128" /> value to a big integer.</summary> 2275public static implicit operator BigInteger(UInt128 value) 4284else if (typeof(TOther) == typeof(UInt128)) 4286UInt128 actualValue = (UInt128)(object)value; 4401else if (typeof(TOther) == typeof(UInt128)) 4403UInt128 actualValue = (UInt128)(object)value; 4518else if (typeof(TOther) == typeof(UInt128)) 4520UInt128 actualValue = (UInt128)(object)value; 4637else if (typeof(TOther) == typeof(UInt128)) 4639UInt128 actualResult = checked((UInt128)value); 4828else if (typeof(TOther) == typeof(UInt128)) 4830UInt128 actualResult = (value >= UInt128.MaxValue) ? UInt128.MaxValue : 4831IsNegative(value) ? UInt128.MinValue : (UInt128)value; 5009UInt128 bits = new UInt128(upperBits, lowerBits); 5162else if (typeof(TOther) == typeof(UInt128)) 5164UInt128 actualResult; 5190UInt128 bits = new UInt128(upperBits, lowerBits); 5201actualResult = (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) ||