20 instantiations of UInt128
Microsoft.CodeAnalysis (2)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
System.IO.Hashing (2)
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (1)
189return new UInt128(
System.Runtime.Numerics (6)
416 references to UInt128
Microsoft.AspNetCore.Components.Endpoints (6)
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Microsoft.AspNetCore.Http.Extensions (6)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.CodeAnalysis (2)
Microsoft.CodeAnalysis.Workspaces (2)
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Shared (1)
Shared.Tests (2)
System.Collections.Immutable (1)
System.ComponentModel.TypeConverter (5)
System.IO.Hashing (2)
System.Linq (9)
System.Net.Primitives (11)
System.Numerics.Tensors (2)
System.Private.CoreLib (288)
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\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)
System.Runtime (1)
System.Runtime.Numerics (51)
System.Text.Json (17)
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)