6 instantiations of Int128
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (1)
77
return new
Int128
(
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
294
return new
Int128
((ulong)high, (ulong)low);
System.Runtime.Numerics (4)
System\Numerics\BigInteger.cs (4)
4696
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
4697
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
4901
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
4902
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
345 references to Int128
Microsoft.AspNetCore.Components.Endpoints (6)
FormMapping\WellKnownConverters.cs (6)
31
{ typeof(
Int128
), new ParsableConverter<
Int128
>() },
63
converters.Add(typeof(
Int128
?), new NullableConverter<
Int128
>((FormDataConverter<
Int128
>)converters[typeof(
Int128
)]));
Microsoft.AspNetCore.Components.Endpoints.Tests (6)
Binding\FormDataMapperTests.cs (6)
2113
{ "-101112", typeof(
Int128
?), new
Int128
?(-(
Int128
)101112)},
2155
{ typeof(
Int128
?) },
2198
{ "-101112", typeof(
Int128
), -(
Int128
)101112 },
Microsoft.AspNetCore.Http.Extensions (6)
src\Components\Endpoints\src\FormMapping\WellKnownConverters.cs (6)
31
{ typeof(
Int128
), new ParsableConverter<
Int128
>() },
63
converters.Add(typeof(
Int128
?), new NullableConverter<
Int128
>((FormDataConverter<
Int128
>)converters[typeof(
Int128
)]));
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiConstants.cs (1)
44
typeof(
Int128
),
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Emit\LocalStateTracing\LocalStateTracingTests.cs (1)
1316
yield return new object[] { "", "System.Int128", "'[System.Runtime]System.Int128'", Unsafe.SizeOf<
Int128
>() };
Microsoft.Extensions.AI.Abstractions (1)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (1)
599
[typeof(
Int128
)] = numberHandling => GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling),
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
68
yield return new TestData<
Int128
>(42, """{"type":"integer"}""");
1213
[JsonSerializable(typeof(
Int128
))]
Shared (1)
JsonSchemaExporter\JsonSchemaExporter.cs (1)
599
[typeof(
Int128
)] = numberHandling => GetSchemaForNumericType(JsonSchemaType.Integer, numberHandling),
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
68
yield return new TestData<
Int128
>(42, """{"type":"integer"}""");
1213
[JsonSerializable(typeof(
Int128
))]
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
71
typeof(T) == typeof(
Int128
) ||
System.ComponentModel.TypeConverter (5)
System\ComponentModel\Int128Converter.cs (4)
18
internal override Type TargetType => typeof(
Int128
);
28
return
Int128
.Parse(value, NumberStyles.HexNumber);
35
Int128
.Parse(value, formatInfo);
41
((
Int128
)value).ToString(formatInfo);
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
161
[typeof(
Int128
)] = new IntrinsicTypeConverterData((type) => new Int128Converter()),
System.Linq (9)
System\Linq\Max.cs (4)
334
if (typeof(TSource) == typeof(
Int128
) && comparer == Comparer<TSource>.Default) return (TSource)(object)MinMaxInteger<
Int128
, MaxCalc<
Int128
>>((IEnumerable<
Int128
>)source);
System\Linq\Min.cs (4)
313
if (typeof(TSource) == typeof(
Int128
) && comparer == Comparer<TSource>.Default) return (TSource)(object)MinMaxInteger<
Int128
, MinCalc<
Int128
>>((IEnumerable<
Int128
>)source);
System\Linq\OrderBy.cs (1)
161
t == typeof(
Int128
) || t == typeof(UInt128) ||
System.Numerics.Tensors (1)
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (1)
78
typeof(T) == typeof(
Int128
) || typeof(T) == typeof(UInt128) ||
System.Private.CoreLib (237)
src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (10)
167
public static byte[] GetBytes(
Int128
value)
169
byte[] bytes = new byte[
Int128
.Size];
181
public static bool TryWriteBytes(Span<byte> destination,
Int128
value)
183
if (destination.Length <
Int128
.Size)
542
public static
Int128
ToInt128(byte[] value, int startIndex)
548
if (startIndex > value.Length -
Int128
.Size)
551
return Unsafe.ReadUnaligned<
Int128
>(ref value[startIndex]);
561
public static
Int128
ToInt128(ReadOnlySpan<byte> value)
563
if (value.Length <
Int128
.Size)
565
return Unsafe.ReadUnaligned<
Int128
>(ref MemoryMarshal.GetReference(value));
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadBigEndian.cs (9)
97
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as big endian.
103
/// <paramref name="source"/> is too small to contain a <see cref="
Int128
" />.
106
public static
Int128
ReadInt128BigEndian(ReadOnlySpan<byte> source)
109
ReverseEndianness(MemoryMarshal.Read<
Int128
>(source)) :
110
MemoryMarshal.Read<
Int128
>(source);
348
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as big endian.
353
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
357
public static bool TryReadInt128BigEndian(ReadOnlySpan<byte> source, out
Int128
value)
361
bool success = MemoryMarshal.TryRead(source, out
Int128
tmp);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadLittleEndian.cs (9)
97
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as little endian.
103
/// <paramref name="source"/> is too small to contain a <see cref="
Int128
" />.
106
public static
Int128
ReadInt128LittleEndian(ReadOnlySpan<byte> source)
109
ReverseEndianness(MemoryMarshal.Read<
Int128
>(source)) :
110
MemoryMarshal.Read<
Int128
>(source);
348
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as little endian.
353
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
357
public static bool TryReadInt128LittleEndian(ReadOnlySpan<byte> source, out
Int128
value)
364
bool success = MemoryMarshal.TryRead(source, out
Int128
tmp);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (7)
70
/// Reverses a primitive value by performing an endianness swap of the specified <see cref="
Int128
" /> value.
75
public static
Int128
ReverseEndianness(
Int128
value)
376
ReverseEndianness(MemoryMarshal.Cast<UInt128,
Int128
>(source), MemoryMarshal.Cast<UInt128,
Int128
>(destination));
379
public static void ReverseEndianness(ReadOnlySpan<
Int128
> source, Span<
Int128
> destination)
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (8)
127
/// Writes a <see cref="
Int128
" /> into a span of bytes, as big endian.
133
/// <paramref name="destination" /> is too small to contain a <see cref="
Int128
" />.
136
public static void WriteInt128BigEndian(Span<byte> destination,
Int128
value)
140
Int128
tmp = ReverseEndianness(value);
421
/// Writes a <see cref="
Int128
" /> into a span of bytes, as big endian.
426
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
430
public static bool TryWriteInt128BigEndian(Span<byte> destination,
Int128
value)
434
Int128
tmp = ReverseEndianness(value);
src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (8)
127
/// Writes a <see cref="
Int128
" /> into a span of bytes, as little endian.
133
/// <paramref name="destination" /> is too small to contain a <see cref="
Int128
" />.
136
public static void WriteInt128LittleEndian(Span<byte> destination,
Int128
value)
140
Int128
tmp = ReverseEndianness(value);
421
/// Writes a <see cref="
Int128
" /> into a span of bytes, as little endian.
426
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
430
public static bool TryWriteInt128LittleEndian(Span<byte> destination,
Int128
value)
434
Int128
tmp = ReverseEndianness(value);
src\libraries\System.Private.CoreLib\src\System\Byte.cs (6)
927
else if (typeof(TOther) == typeof(
Int128
))
929
Int128
actualResult = value;
1001
else if (typeof(TOther) == typeof(
Int128
))
1003
Int128
actualResult = value;
1075
else if (typeof(TOther) == typeof(
Int128
))
1077
Int128
actualResult = value;
src\libraries\System.Private.CoreLib\src\System\Char.cs (6)
1740
else if (typeof(TOther) == typeof(
Int128
))
1742
Int128
actualResult = value;
1814
else if (typeof(TOther) == typeof(
Int128
))
1816
Int128
actualResult = value;
1888
else if (typeof(TOther) == typeof(
Int128
))
1890
Int128
actualResult = value;
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (6)
1681
else if (typeof(TOther) == typeof(
Int128
))
1683
Int128
actualResult = checked((
Int128
)value);
1772
else if (typeof(TOther) == typeof(
Int128
))
1774
Int128
actualResult = (
Int128
)value;
src\libraries\System.Private.CoreLib\src\System\Double.cs (3)
1266
else if (typeof(TOther) == typeof(
Int128
))
1268
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Half.cs (10)
871
/// <summary>Explicitly converts a half-precision floating-point value to its nearest representable <see cref="
Int128
"/>.</summary>
874
public static explicit operator
Int128
(Half value) => (
Int128
)(double)(value);
876
/// <summary>Explicitly converts a half-precision floating-point value to its nearest representable <see cref="
Int128
"/>, throwing an overflow exception for any values that fall outside the representable range.</summary>
879
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
880
public static explicit operator checked
Int128
(Half value) => checked((
Int128
)(double)(value));
1968
else if (typeof(TOther) == typeof(
Int128
))
1970
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Int128.cs (26)
18
: IBinaryInteger<
Int128
>,
19
IMinMaxValue<
Int128
>,
20
ISignedNumber<
Int128
>,
22
IBinaryIntegerParseAndFormatInfo<
Int128
>
34
/// <summary>Initializes a new instance of the <see cref="
Int128
" /> struct.</summary>
51
if (value is
Int128
other)
66
public int CompareTo(
Int128
value)
85
return (obj is
Int128
other) && Equals(other);
89
public bool Equals(
Int128
other)
129
public static
Int128
Parse(string s) => Parse(s, NumberStyles.Integer, provider: null);
131
public static
Int128
Parse(string s, NumberStyles style) => Parse(s, style, provider: null);
133
public static
Int128
Parse(string s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider);
135
public static
Int128
Parse(string s, NumberStyles style, IFormatProvider? provider)
141
public static
Int128
Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
144
return Number.ParseBinaryInteger<char,
Int128
>(s, style, NumberFormatInfo.GetInstance(provider));
147
public static bool TryParse([NotNullWhen(true)] string? s, out
Int128
result) => TryParse(s, NumberStyles.Integer, provider: null, out result);
149
public static bool TryParse(ReadOnlySpan<char> s, out
Int128
result) => TryParse(s, NumberStyles.Integer, provider: null, out result);
155
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
Int128
result) => TryParse(utf8Text, NumberStyles.Integer, provider: null, out result);
157
public static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out
Int128
result)
169
public static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out
Int128
result)
182
public static explicit operator byte(
Int128
value) => (byte)value._lower;
187
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
188
public static explicit operator checked byte(
Int128
value)
200
public static explicit operator char(
Int128
value) => (char)value._lower;
205
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
206
public static explicit operator checked char(
Int128
value)
src\libraries\System.Private.CoreLib\src\System\Int16.cs (9)
913
else if (typeof(TOther) == typeof(
Int128
))
915
Int128
actualValue = (
Int128
)(object)value;
989
else if (typeof(TOther) == typeof(
Int128
))
991
Int128
actualValue = (
Int128
)(object)value;
1066
else if (typeof(TOther) == typeof(
Int128
))
1068
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Int32.cs (9)
954
else if (typeof(TOther) == typeof(
Int128
))
956
Int128
actualValue = (
Int128
)(object)value;
1029
else if (typeof(TOther) == typeof(
Int128
))
1031
Int128
actualValue = (
Int128
)(object)value;
1106
else if (typeof(TOther) == typeof(
Int128
))
1108
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Int64.cs (10)
54
public static
Int128
BigMul(long left, long right) => Math.BigMul(left, right);
951
else if (typeof(TOther) == typeof(
Int128
))
953
Int128
actualValue = (
Int128
)(object)value;
1025
else if (typeof(TOther) == typeof(
Int128
))
1027
Int128
actualValue = (
Int128
)(object)value;
1101
else if (typeof(TOther) == typeof(
Int128
))
1103
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (9)
952
else if (typeof(TOther) == typeof(
Int128
))
954
Int128
actualValue = (
Int128
)(object)value;
1027
else if (typeof(TOther) == typeof(
Int128
))
1029
Int128
actualValue = (
Int128
)(object)value;
1103
else if (typeof(TOther) == typeof(
Int128
))
1105
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
291
public static
Int128
BigMul(long a, long b)
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (24)
1101
public static string FormatInt128(
Int128
value, string? format, IFormatProvider? provider)
1106
return
Int128
.IsPositive(value)
1113
static unsafe string FormatInt128Slow(
Int128
value, string? format, IFormatProvider? provider)
1122
return
Int128
.IsPositive(value)
1162
public static bool TryFormatInt128<TChar>(
Int128
value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
1169
return
Int128
.IsPositive(value)
1176
static unsafe bool TryFormatInt128Slow(
Int128
value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten)
1183
return
Int128
.IsPositive(value)
1246
return Int128ToHexStr((
Int128
)value, GetHexBase(fmt), digits);
1250
return UInt128ToBinaryStr((
Int128
)value, digits);
1303
return TryInt128ToHexStr((
Int128
)value, GetHexBase(fmt), digits, destination, out charsWritten);
1307
return TryUInt128ToBinaryStr((
Int128
)value, digits, destination, out charsWritten);
2195
private static unsafe void Int128ToNumber(
Int128
value, ref NumberBuffer number)
2199
if (
Int128
.IsPositive(value))
2227
public static string Int128ToDecStr(
Int128
value)
2229
return
Int128
.IsPositive(value)
2234
private static unsafe string NegativeInt128ToDecStr(
Int128
value, int digits, string sNegative)
2236
Debug.Assert(
Int128
.IsNegative(value));
2261
private static unsafe bool TryNegativeInt128ToDecStr<TChar>(
Int128
value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
2264
Debug.Assert(
Int128
.IsNegative(value));
2295
private static unsafe string Int128ToHexStr(
Int128
value, char hexBase, int digits)
2314
private static unsafe bool TryInt128ToHexStr<TChar>(
Int128
value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
2358
private static unsafe string UInt128ToBinaryStr(
Int128
value, int digits)
2377
private static unsafe bool TryUInt128ToBinaryStr<TChar>(
Int128
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 (23)
329
/// <summary>Explicitly converts a native-sized floating-point value to its nearest representable <see cref="
Int128
" /> value.</summary>
331
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="
Int128
" /> value.</returns>
333
public static explicit operator
Int128
(NFloat value) => (
Int128
)(value._value);
335
/// <summary>Explicitly converts a native-sized floating-point value to its nearest representable <see cref="
Int128
" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
337
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="
Int128
" /> value.</returns>
338
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
340
public static explicit operator checked
Int128
(NFloat value) => checked((
Int128
)(value._value));
491
/// <summary>Explicitly converts a <see cref="
Int128
" /> to its nearest representable native-sized floating-point value.</summary>
495
public static explicit operator NFloat(
Int128
value)
497
if (
Int128
.IsNegative(value))
1465
else if (typeof(TOther) == typeof(
Int128
))
1467
Int128
actualValue = (
Int128
)(object)value;
1578
else if (typeof(TOther) == typeof(
Int128
))
1580
Int128
actualResult = checked((
Int128
)value);
1712
else if (typeof(TOther) == typeof(
Int128
))
1714
Int128
actualResult = (value >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
1715
(value <= -170141183460469231731687303715884105728.0) ?
Int128
.MinValue : (
Int128
)value;
src\libraries\System.Private.CoreLib\src\System\SByte.cs (9)
882
else if (typeof(TOther) == typeof(
Int128
))
884
Int128
actualValue = (
Int128
)(object)value;
959
else if (typeof(TOther) == typeof(
Int128
))
961
Int128
actualValue = (
Int128
)(object)value;
1036
else if (typeof(TOther) == typeof(
Int128
))
1038
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\Single.cs (3)
1291
else if (typeof(TOther) == typeof(
Int128
))
1293
Int128
actualValue = (
Int128
)(object)value;
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (6)
479
Int128
totalMicroseconds = Math.BigMul(days, MicrosecondsPerDay)
515
Int128
totalMicroseconds = Math.BigMul(hours, MicrosecondsPerHour)
549
Int128
totalMicroseconds = Math.BigMul(minutes, MicrosecondsPerMinute)
581
Int128
totalMicroseconds = Math.BigMul(seconds, MicrosecondsPerSecond)
612
Int128
totalMicroseconds = Math.BigMul(milliseconds, MicrosecondsPerMillisecond)
619
private static TimeSpan FromMicroseconds(
Int128
microseconds)
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (6)
946
else if (typeof(TOther) == typeof(
Int128
))
948
Int128
actualResult = value;
1020
else if (typeof(TOther) == typeof(
Int128
))
1022
Int128
actualResult = value;
1094
else if (typeof(TOther) == typeof(
Int128
))
1096
Int128
actualResult = value;
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (6)
985
else if (typeof(TOther) == typeof(
Int128
))
987
Int128
actualResult = value;
1059
else if (typeof(TOther) == typeof(
Int128
))
1061
Int128
actualResult = value;
1139
else if (typeof(TOther) == typeof(
Int128
))
1141
Int128
actualResult = value;
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (8)
984
else if (typeof(TOther) == typeof(
Int128
))
986
Int128
actualResult = checked((
Int128
)value);
1058
else if (typeof(TOther) == typeof(
Int128
))
1060
Int128
actualResult = value;
1132
else if (typeof(TOther) == typeof(
Int128
))
1134
Int128
actualResult = (
Int128
)value;
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (6)
987
else if (typeof(TOther) == typeof(
Int128
))
989
Int128
actualResult = value;
1061
else if (typeof(TOther) == typeof(
Int128
))
1063
Int128
actualResult = value;
1135
else if (typeof(TOther) == typeof(
Int128
))
1137
Int128
actualResult = value;
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net10.0\System.Runtime.Forwards.cs (1)
279
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.
Int128
))]
System.Runtime.Numerics (48)
System\Numerics\BigInteger.cs (30)
1930
/// <summary>Explicitly converts a big integer to a <see cref="
Int128
" /> value.</summary>
1932
/// <returns><paramref name="value" /> converted to <see cref="
Int128
" /> value.</returns>
1933
public static explicit operator
Int128
(BigInteger value)
1967
Int128
ll = (value._sign > 0) ? unchecked((
Int128
)uu) : unchecked(-(
Int128
)uu);
2170
/// <summary>Implicitly converts a <see cref="
Int128
" /> value to a big integer.</summary>
2173
public static implicit operator BigInteger(
Int128
value)
4242
else if (typeof(TOther) == typeof(
Int128
))
4244
Int128
actualValue = (
Int128
)(object)value;
4359
else if (typeof(TOther) == typeof(
Int128
))
4361
Int128
actualValue = (
Int128
)(object)value;
4476
else if (typeof(TOther) == typeof(
Int128
))
4478
Int128
actualValue = (
Int128
)(object)value;
4589
else if (typeof(TOther) == typeof(
Int128
))
4591
Int128
actualResult = checked((
Int128
)value);
4754
else if (typeof(TOther) == typeof(
Int128
))
4756
Int128
actualResult = (value >=
Int128
.MaxValue) ?
Int128
.MaxValue :
4757
(value <=
Int128
.MinValue) ?
Int128
.MinValue : (
Int128
)value;
4981
else if (typeof(TOther) == typeof(
Int128
))
4983
Int128
actualResult;
5016
actualResult = (
Int128
)bits;
System\Numerics\Complex.cs (18)
783
/// <summary>Explicitly converts a <see cref="
Int128
" /> value to a double-precision complex number.</summary>
786
public static explicit operator Complex(
Int128
value)
1549
else if (typeof(TOther) == typeof(
Int128
))
1551
Int128
actualValue = (
Int128
)(object)value;
1697
else if (typeof(TOther) == typeof(
Int128
))
1704
Int128
actualResult = checked((
Int128
)value.m_real);
1878
else if (typeof(TOther) == typeof(
Int128
))
1880
Int128
actualResult = (value.m_real >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
1881
(value.m_real <= -170141183460469231731687303715884105728.0) ?
Int128
.MinValue : (
Int128
)value.m_real;
2014
else if (typeof(TOther) == typeof(
Int128
))
2016
Int128
actualResult = (value.m_real >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
2017
(value.m_real <= -170141183460469231731687303715884105728.0) ?
Int128
.MinValue : (
Int128
)value.m_real;
System.Text.Json (17)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
102
if (type == typeof(Half) || type == typeof(UInt128) || type == typeof(
Int128
))
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (12)
12
internal sealed class Int128Converter : JsonPrimitiveConverter<
Int128
>
21
public override
Int128
Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
31
public override void Write(Utf8JsonWriter writer,
Int128
value, JsonSerializerOptions options)
36
private static
Int128
ReadCore(ref Utf8JsonReader reader)
46
if (!
Int128
.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out
Int128
result))
59
private static void WriteCore(Utf8JsonWriter writer,
Int128
value)
66
internal override
Int128
ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
72
internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer,
Int128
value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
79
internal override
Int128
ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
90
internal override void WriteNumberWithCustomHandling(Utf8JsonWriter writer,
Int128
value, JsonNumberHandling handling)
114
Int128
value, out int written)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
113
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="
Int128
"/> values.
116
public static JsonConverter<
Int128
> Int128Converter => s_int128Converter ??= new Int128Converter();
117
private static JsonConverter<
Int128
>? s_int128Converter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
730
potentialNumberType == typeof(
Int128
) ||