44 instantiations of Int128
System.Private.CoreLib (40)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReverseEndianness.cs (1)
77
return new
Int128
(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (36)
474
Int128 result = new
Int128
(value.High, value.Low64);
551
Int128 result = new
Int128
((bits << 12) >> 1 | 0x8000_0000_0000_0000, 0x0000_0000_0000_0000);
585
public static implicit operator Int128(byte value) => new
Int128
(0, value);
590
public static implicit operator Int128(char value) => new
Int128
(0, value);
598
return new
Int128
((ulong)(lower >> 63), (ulong)lower);
607
return new
Int128
((ulong)(lower >> 63), (ulong)lower);
616
return new
Int128
((ulong)(lower >> 63), (ulong)lower);
625
return new
Int128
((ulong)(lower >> 63), (ulong)lower);
635
return new
Int128
((ulong)(lower >> 63), (ulong)lower);
642
public static implicit operator Int128(ushort value) => new
Int128
(0, value);
648
public static implicit operator Int128(uint value) => new
Int128
(0, value);
654
public static implicit operator Int128(ulong value) => new
Int128
(0, value);
660
public static implicit operator Int128(nuint value) => new
Int128
(0, value);
676
return new
Int128
(upper, lower);
961
static Int128 IBinaryNumber<Int128>.AllBitsSet => new
Int128
(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
986
public static Int128 operator &(Int128 left, Int128 right) => new
Int128
(left._upper & right._upper, left._lower & right._lower);
989
public static Int128 operator |(Int128 left, Int128 right) => new
Int128
(left._upper | right._upper, left._lower | right._lower);
992
public static Int128 operator ^(Int128 left, Int128 right) => new
Int128
(left._upper ^ right._upper, left._lower ^ right._lower);
995
public static Int128 operator ~(Int128 value) => new
Int128
(~value._upper, ~value._lower);
1083
return new
Int128
(
1117
public static Int128 MinValue => new
Int128
(0x8000_0000_0000_0000, 0);
1120
public static Int128 MaxValue => new
Int128
(0x7FFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
1270
public static Int128 One => new
Int128
(0, 1);
1803
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
1804
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
1876
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
1877
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
1944
return new
Int128
(upper, 0);
1954
return new
Int128
(upper, lower);
1979
return new
Int128
(upper, lower);
1989
return new
Int128
(upper, lower);
2012
return new
Int128
(0, lower);
2022
return new
Int128
(upper, lower);
2035
public static Int128 NegativeOne => new
Int128
(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
2061
return new
Int128
(upper, lower);
2132
static Int128 IBinaryIntegerParseAndFormatInfo<Int128>.MaxValueDiv10 => new
Int128
(0x0CCC_CCCC_CCCC_CCCC, 0xCCCC_CCCC_CCCC_CCCC);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
298
return new
Int128
((ulong)high, (ulong)low);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (2)
348
public static explicit operator Int128(UInt128 value) => new
Int128
(value._upper, value._lower);
361
return new
Int128
(value._upper, value._lower);
System.Runtime.Numerics (4)
System\Numerics\BigInteger.cs (4)
4609
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
4610
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
4820
decimal actualResult = (value >= new
Int128
(0x0000_0000_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ? decimal.MaxValue :
4821
(value <= new
Int128
(0xFFFF_FFFF_0000_0000, 0x0000_0000_0000_0001)) ? decimal.MinValue : (decimal)value;
715 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.Http.Extensions (6)
src\aspnetcore\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.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
65
yield return new TestData<
Int128
>(42, """{"type":"integer"}""");
1225
[JsonSerializable(typeof(
Int128
))]
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
65
yield return new TestData<
Int128
>(42, """{"type":"integer"}""");
1225
[JsonSerializable(typeof(
Int128
))]
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
70
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)
160
[typeof(
Int128
)] = new IntrinsicTypeConverterData((type) => new Int128Converter()),
System.Linq (11)
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\Linq\Sequence.cs (2)
92
if (typeof(T) == typeof(long) && (range = TryUseRange<
Int128
>(start, endInclusive, step, long.MaxValue)) is not null) return range;
94
if (typeof(T) == typeof(nint) && (range = TryUseRange<
Int128
>(start, endInclusive, step, nint.MaxValue)) is not null) return range;
System.Numerics.Tensors (1)
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (1)
77
typeof(T) == typeof(
Int128
) || typeof(T) == typeof(UInt128) ||
System.Private.CoreLib (598)
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (10)
168
public static byte[] GetBytes(
Int128
value)
170
byte[] bytes = new byte[
Int128
.Size];
182
public static bool TryWriteBytes(Span<byte> destination,
Int128
value)
184
if (destination.Length <
Int128
.Size)
571
public static
Int128
ToInt128(byte[] value, int startIndex)
577
if (startIndex > value.Length -
Int128
.Size)
580
return Unsafe.ReadUnaligned<
Int128
>(ref value[startIndex]);
590
public static
Int128
ToInt128(ReadOnlySpan<byte> value)
592
if (value.Length <
Int128
.Size)
594
return Unsafe.ReadUnaligned<
Int128
>(ref MemoryMarshal.GetReference(value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadBigEndian.cs (9)
115
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as big endian.
121
/// <paramref name="source"/> is too small to contain a <see cref="
Int128
" />.
124
public static
Int128
ReadInt128BigEndian(ReadOnlySpan<byte> source)
127
ReverseEndianness(MemoryMarshal.Read<
Int128
>(source)) :
128
MemoryMarshal.Read<
Int128
>(source);
388
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as big endian.
393
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
397
public static bool TryReadInt128BigEndian(ReadOnlySpan<byte> source, out
Int128
value)
401
bool success = MemoryMarshal.TryRead(source, out
Int128
tmp);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.ReadLittleEndian.cs (9)
115
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as little endian.
121
/// <paramref name="source"/> is too small to contain a <see cref="
Int128
" />.
124
public static
Int128
ReadInt128LittleEndian(ReadOnlySpan<byte> source)
127
ReverseEndianness(MemoryMarshal.Read<
Int128
>(source)) :
128
MemoryMarshal.Read<
Int128
>(source);
388
/// Reads a <see cref="
Int128
" /> from the beginning of a read-only span of bytes, as little endian.
393
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
397
public static bool TryReadInt128LittleEndian(ReadOnlySpan<byte> source, out
Int128
value)
404
bool success = MemoryMarshal.TryRead(source, out
Int128
tmp);
src\runtime\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\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteBigEndian.cs (8)
151
/// Writes a <see cref="
Int128
" /> into a span of bytes, as big endian.
157
/// <paramref name="destination" /> is too small to contain a <see cref="
Int128
" />.
160
public static void WriteInt128BigEndian(Span<byte> destination,
Int128
value)
164
Int128
tmp = ReverseEndianness(value);
466
/// Writes a <see cref="
Int128
" /> into a span of bytes, as big endian.
471
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
475
public static bool TryWriteInt128BigEndian(Span<byte> destination,
Int128
value)
479
Int128
tmp = ReverseEndianness(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Binary\BinaryPrimitives.WriteLittleEndian.cs (8)
151
/// Writes a <see cref="
Int128
" /> into a span of bytes, as little endian.
157
/// <paramref name="destination" /> is too small to contain a <see cref="
Int128
" />.
160
public static void WriteInt128LittleEndian(Span<byte> destination,
Int128
value)
164
Int128
tmp = ReverseEndianness(value);
466
/// Writes a <see cref="
Int128
" /> into a span of bytes, as little endian.
471
/// <see langword="true" /> if the span is large enough to contain a <see cref="
Int128
" />; otherwise, <see langword="false" />.
475
public static bool TryWriteInt128LittleEndian(Span<byte> destination,
Int128
value)
479
Int128
tmp = ReverseEndianness(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (6)
928
else if (typeof(TOther) == typeof(
Int128
))
930
Int128
actualResult = value;
1002
else if (typeof(TOther) == typeof(
Int128
))
1004
Int128
actualResult = value;
1076
else if (typeof(TOther) == typeof(
Int128
))
1078
Int128
actualResult = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (6)
1779
else if (typeof(TOther) == typeof(
Int128
))
1781
Int128
actualResult = value;
1853
else if (typeof(TOther) == typeof(
Int128
))
1855
Int128
actualResult = value;
1927
else if (typeof(TOther) == typeof(
Int128
))
1929
Int128
actualResult = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (6)
1660
else if (typeof(TOther) == typeof(
Int128
))
1662
Int128
actualResult = checked((
Int128
)value);
1751
else if (typeof(TOther) == typeof(
Int128
))
1753
Int128
actualResult = (
Int128
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (3)
1288
else if (typeof(TOther) == typeof(
Int128
))
1290
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (10)
873
/// <summary>Explicitly converts a half-precision floating-point value to its nearest representable <see cref="
Int128
"/>.</summary>
876
public static explicit operator
Int128
(Half value) => (
Int128
)(double)(value);
878
/// <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>
881
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
882
public static explicit operator checked
Int128
(Half value) => checked((
Int128
)(double)(value));
1967
else if (typeof(TOther) == typeof(
Int128
))
1969
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (349)
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)
218
public static explicit operator decimal(
Int128
value)
231
public static explicit operator double(
Int128
value)
244
public static explicit operator Half(
Int128
value)
257
public static explicit operator short(
Int128
value) => (short)value._lower;
262
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
263
public static explicit operator checked short(
Int128
value)
276
public static explicit operator int(
Int128
value) => (int)value._lower;
281
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
282
public static explicit operator checked int(
Int128
value)
295
public static explicit operator long(
Int128
value) => (long)value._lower;
300
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
301
public static explicit operator checked long(
Int128
value)
314
public static explicit operator nint(
Int128
value) => (nint)value._lower;
319
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
320
public static explicit operator checked nint(
Int128
value)
334
public static explicit operator sbyte(
Int128
value) => (sbyte)value._lower;
339
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
341
public static explicit operator checked sbyte(
Int128
value)
354
public static explicit operator float(
Int128
value)
368
public static explicit operator ushort(
Int128
value) => (ushort)value._lower;
373
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
375
public static explicit operator checked ushort(
Int128
value)
388
public static explicit operator uint(
Int128
value) => (uint)value._lower;
393
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
395
public static explicit operator checked uint(
Int128
value)
408
public static explicit operator ulong(
Int128
value) => value._lower;
413
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
415
public static explicit operator checked ulong(
Int128
value)
428
public static explicit operator UInt128(
Int128
value) => new UInt128(value._upper, value._lower);
433
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
435
public static explicit operator checked UInt128(
Int128
value)
448
public static explicit operator nuint(
Int128
value) => (nuint)value._lower;
453
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
455
public static explicit operator checked nuint(
Int128
value)
471
public static explicit operator
Int128
(decimal value)
474
Int128
result = new Int128(value.High, value.Low64);
486
public static explicit operator
Int128
(double value)
509
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
510
public static explicit operator checked
Int128
(double value)
522
internal static
Int128
ToInt128(double value)
551
Int128
result = new Int128((bits << 12) >> 1 | 0x8000_0000_0000_0000, 0x0000_0000_0000_0000);
570
public static explicit operator
Int128
(float value) => (
Int128
)(double)(value);
575
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
576
public static explicit operator checked
Int128
(float value) => checked((
Int128
)(double)(value));
585
public static implicit operator
Int128
(byte value) => new Int128(0, value);
590
public static implicit operator
Int128
(char value) => new Int128(0, value);
595
public static implicit operator
Int128
(short value)
604
public static implicit operator
Int128
(int value)
613
public static implicit operator
Int128
(long value)
622
public static implicit operator
Int128
(nint value)
632
public static implicit operator
Int128
(sbyte value)
642
public static implicit operator
Int128
(ushort value) => new Int128(0, value);
648
public static implicit operator
Int128
(uint value) => new Int128(0, value);
654
public static implicit operator
Int128
(ulong value) => new Int128(0, value);
660
public static implicit operator
Int128
(nuint value) => new Int128(0, value);
667
public static
Int128
operator +(
Int128
left,
Int128
right)
680
public static
Int128
operator checked +(
Int128
left,
Int128
right)
687
Int128
result = left + right;
701
static
Int128
IAdditiveIdentity<
Int128
,
Int128
>.AdditiveIdentity => default;
708
public static (
Int128
Quotient,
Int128
Remainder) DivRem(
Int128
left,
Int128
right)
710
Int128
quotient = left / right;
715
public static
Int128
LeadingZeroCount(
Int128
value)
720
private static int LeadingZeroCountAsInt32(
Int128
value)
730
public static
Int128
Log10(
Int128
value)
736
return (
Int128
)UInt128.Log10((UInt128)value);
740
public static
Int128
PopCount(
Int128
value)
744
public static
Int128
RotateLeft(
Int128
value, int rotateAmount)
748
public static
Int128
RotateRight(
Int128
value, int rotateAmount)
752
public static
Int128
TrailingZeroCount(
Int128
value)
762
static bool IBinaryInteger<
Int128
>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
Int128
value)
764
Int128
result = default;
835
static bool IBinaryInteger<
Int128
>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
Int128
value)
837
Int128
result = default;
913
int IBinaryInteger<
Int128
>.GetShortestBitLength()
915
Int128
value = this;
928
int IBinaryInteger<
Int128
>.GetByteCount() => Size;
931
bool IBinaryInteger<
Int128
>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten)
944
bool IBinaryInteger<
Int128
>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
961
static
Int128
IBinaryNumber<
Int128
>.AllBitsSet => new Int128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
964
public static bool IsPow2(
Int128
value) => (PopCount(value) == 1U) && IsPositive(value);
967
public static
Int128
Log2(
Int128
value)
986
public static
Int128
operator &(
Int128
left,
Int128
right) => new Int128(left._upper & right._upper, left._lower & right._lower);
989
public static
Int128
operator |(
Int128
left,
Int128
right) => new Int128(left._upper | right._upper, left._lower | right._lower);
992
public static
Int128
operator ^(
Int128
left,
Int128
right) => new Int128(left._upper ^ right._upper, left._lower ^ right._lower);
995
public static
Int128
operator ~(
Int128
value) => new Int128(~value._upper, ~value._lower);
1002
public static bool operator <(
Int128
left,
Int128
right)
1016
public static bool operator <=(
Int128
left,
Int128
right)
1024
public static bool operator >(
Int128
left,
Int128
right)
1032
public static bool operator >=(
Int128
left,
Int128
right)
1044
public static
Int128
operator --(
Int128
value) => value - One;
1047
public static
Int128
operator checked --(
Int128
value) => checked(value - One);
1054
public static
Int128
operator /(
Int128
left,
Int128
right)
1090
public static
Int128
operator checked /(
Int128
left,
Int128
right) => left / right;
1097
public static bool operator ==(
Int128
left,
Int128
right) => (left._lower == right._lower) && (left._upper == right._upper);
1100
public static bool operator !=(
Int128
left,
Int128
right) => (left._lower != right._lower) || (left._upper != right._upper);
1107
public static
Int128
operator ++(
Int128
value) => value + One;
1110
public static
Int128
operator checked ++(
Int128
value) => checked(value + One);
1117
public static
Int128
MinValue => new Int128(0x8000_0000_0000_0000, 0);
1120
public static
Int128
MaxValue => new Int128(0x7FFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
1127
public static
Int128
operator %(
Int128
left,
Int128
right)
1129
Int128
quotient = left / right;
1138
static
Int128
IMultiplicativeIdentity<
Int128
,
Int128
>.MultiplicativeIdentity => One;
1145
public static
Int128
operator *(
Int128
left,
Int128
right)
1148
return (
Int128
)((UInt128)(left) * (UInt128)(right));
1152
public static
Int128
operator checked *(
Int128
left,
Int128
right)
1154
Int128
upper = BigMul(left, right, out
Int128
lower);
1182
public static
Int128
BigMul(
Int128
left,
Int128
right, out
Int128
lower)
1187
lower = (
Int128
)(ulower);
1188
return (
Int128
)(upper) - ((left >> 127) & right) - ((right >> 127) & left);
1196
public static
Int128
Clamp(
Int128
value,
Int128
min,
Int128
max)
1216
public static
Int128
CopySign(
Int128
value,
Int128
sign)
1218
Int128
absValue = value;
1237
public static
Int128
Max(
Int128
x,
Int128
y) => (x >= y) ? x : y;
1240
static
Int128
INumber<
Int128
>.MaxNumber(
Int128
x,
Int128
y) => Max(x, y);
1243
public static
Int128
Min(
Int128
x,
Int128
y) => (x <= y) ? x : y;
1246
static
Int128
INumber<
Int128
>.MinNumber(
Int128
x,
Int128
y) => Min(x, y);
1249
public static int Sign(
Int128
value)
1270
public static
Int128
One => new Int128(0, 1);
1273
static int INumberBase<
Int128
>.Radix => 2;
1276
public static
Int128
Zero => default;
1279
public static
Int128
Abs(
Int128
value)
1295
public static
Int128
CreateChecked<TOther>(TOther value)
1298
Int128
result;
1300
if (typeof(TOther) == typeof(
Int128
))
1302
result = (
Int128
)(object)value;
1314
public static
Int128
CreateSaturating<TOther>(TOther value)
1317
Int128
result;
1319
if (typeof(TOther) == typeof(
Int128
))
1321
result = (
Int128
)(object)value;
1333
public static
Int128
CreateTruncating<TOther>(TOther value)
1336
Int128
result;
1338
if (typeof(TOther) == typeof(
Int128
))
1340
result = (
Int128
)(object)value;
1351
static bool INumberBase<
Int128
>.IsCanonical(
Int128
value) => true;
1354
static bool INumberBase<
Int128
>.IsComplexNumber(
Int128
value) => false;
1357
public static bool IsEvenInteger(
Int128
value) => (value._lower & 1) == 0;
1360
static bool INumberBase<
Int128
>.IsFinite(
Int128
value) => true;
1363
static bool INumberBase<
Int128
>.IsImaginaryNumber(
Int128
value) => false;
1366
static bool INumberBase<
Int128
>.IsInfinity(
Int128
value) => false;
1369
static bool INumberBase<
Int128
>.IsInteger(
Int128
value) => true;
1372
static bool INumberBase<
Int128
>.IsNaN(
Int128
value) => false;
1375
public static bool IsNegative(
Int128
value) => (long)value._upper < 0;
1378
static bool INumberBase<
Int128
>.IsNegativeInfinity(
Int128
value) => false;
1381
static bool INumberBase<
Int128
>.IsNormal(
Int128
value) => value != 0;
1384
public static bool IsOddInteger(
Int128
value) => (value._lower & 1) != 0;
1387
public static bool IsPositive(
Int128
value) => (long)value._upper >= 0;
1390
static bool INumberBase<
Int128
>.IsPositiveInfinity(
Int128
value) => false;
1393
static bool INumberBase<
Int128
>.IsRealNumber(
Int128
value) => true;
1396
static bool INumberBase<
Int128
>.IsSubnormal(
Int128
value) => false;
1399
static bool INumberBase<
Int128
>.IsZero(
Int128
value) => (value == 0);
1402
public static
Int128
MaxMagnitude(
Int128
x,
Int128
y)
1404
Int128
absX = x;
1416
Int128
absY = y;
1442
static
Int128
INumberBase<
Int128
>.MaxMagnitudeNumber(
Int128
x,
Int128
y) => MaxMagnitude(x, y);
1445
public static
Int128
MinMagnitude(
Int128
x,
Int128
y)
1447
Int128
absX = x;
1459
Int128
absY = y;
1485
static
Int128
INumberBase<
Int128
>.MinMagnitudeNumber(
Int128
x,
Int128
y) => MinMagnitude(x, y);
1488
static
Int128
INumberBase<
Int128
>.MultiplyAddEstimate(
Int128
left,
Int128
right,
Int128
addend) => (left * right) + addend;
1492
static bool INumberBase<
Int128
>.TryConvertFromChecked<TOther>(TOther value, out
Int128
result) => TryConvertFromChecked(value, out result);
1495
private static bool TryConvertFromChecked<TOther>(TOther value, out
Int128
result)
1510
result = checked((
Int128
)actualValue);
1516
result = checked((
Int128
)actualValue);
1552
result = checked((
Int128
)actualValue);
1564
static bool INumberBase<
Int128
>.TryConvertFromSaturating<TOther>(TOther value, out
Int128
result) => TryConvertFromSaturating(value, out result);
1567
private static bool TryConvertFromSaturating<TOther>(TOther value, out
Int128
result)
1582
result = (
Int128
)actualValue;
1588
result = (
Int128
)actualValue;
1624
result = (
Int128
)actualValue;
1636
static bool INumberBase<
Int128
>.TryConvertFromTruncating<TOther>(TOther value, out
Int128
result) => TryConvertFromTruncating(value, out result);
1639
private static bool TryConvertFromTruncating<TOther>(TOther value, out
Int128
result)
1654
result = (
Int128
)actualValue;
1660
result = (
Int128
)actualValue;
1696
result = (
Int128
)actualValue;
1708
static bool INumberBase<
Int128
>.TryConvertToChecked<TOther>(
Int128
value, [MaybeNullWhen(false)] out TOther result)
1776
static bool INumberBase<
Int128
>.TryConvertToSaturating<TOther>(
Int128
value, [MaybeNullWhen(false)] out TOther result)
1851
static bool INumberBase<
Int128
>.TryConvertToTruncating<TOther>(
Int128
value, [MaybeNullWhen(false)] out TOther result)
1923
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
Int128
result) => TryParse(s, NumberStyles.Integer, provider, out result);
1930
public static
Int128
operator <<(
Int128
value, int shiftAmount)
1963
public static
Int128
operator >>(
Int128
value, int shiftAmount)
1998
public static
Int128
operator >>>(
Int128
value, int shiftAmount)
2035
public static
Int128
NegativeOne => new Int128(0xFFFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF);
2042
public static
Int128
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider);
2045
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
Int128
result) => TryParse(s, NumberStyles.Integer, provider, out result);
2052
public static
Int128
operator -(
Int128
left,
Int128
right)
2065
public static
Int128
operator checked -(
Int128
left,
Int128
right)
2072
Int128
result = left - right;
2086
public static
Int128
operator -(
Int128
value) => Zero - value;
2089
public static
Int128
operator checked -(
Int128
value) => checked(Zero - value);
2096
public static
Int128
operator +(
Int128
value) => value;
2103
public static
Int128
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
2106
return Number.ParseBinaryInteger<byte,
Int128
>(utf8Text, style, NumberFormatInfo.GetInstance(provider));
2110
public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
Int128
result)
2117
public static
Int128
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Integer, provider);
2120
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
Int128
result) => TryParse(utf8Text, NumberStyles.Integer, provider, out result);
2126
static bool IBinaryIntegerParseAndFormatInfo<
Int128
>.IsSigned => true;
2128
static int IBinaryIntegerParseAndFormatInfo<
Int128
>.MaxDigitCount => 39; // 170_141_183_460_469_231_731_687_303_715_884_105_727
2130
static int IBinaryIntegerParseAndFormatInfo<
Int128
>.MaxHexDigitCount => 32; // 0x7FFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF_FFFF
2132
static
Int128
IBinaryIntegerParseAndFormatInfo<
Int128
>.MaxValueDiv10 => new Int128(0x0CCC_CCCC_CCCC_CCCC, 0xCCCC_CCCC_CCCC_CCCC);
2134
static string IBinaryIntegerParseAndFormatInfo<
Int128
>.OverflowMessage => SR.Overflow_Int128;
2136
static bool IBinaryIntegerParseAndFormatInfo<
Int128
>.IsGreaterThanAsUnsigned(
Int128
left,
Int128
right) => (UInt128)(left) > (UInt128)(right);
2138
static
Int128
IBinaryIntegerParseAndFormatInfo<
Int128
>.MultiplyBy10(
Int128
value) => value * 10;
2140
static
Int128
IBinaryIntegerParseAndFormatInfo<
Int128
>.MultiplyBy16(
Int128
value) => value * 16;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (9)
907
else if (typeof(TOther) == typeof(
Int128
))
909
Int128
actualValue = (
Int128
)(object)value;
983
else if (typeof(TOther) == typeof(
Int128
))
985
Int128
actualValue = (
Int128
)(object)value;
1060
else if (typeof(TOther) == typeof(
Int128
))
1062
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (9)
949
else if (typeof(TOther) == typeof(
Int128
))
951
Int128
actualValue = (
Int128
)(object)value;
1032
else if (typeof(TOther) == typeof(
Int128
))
1034
Int128
actualValue = (
Int128
)(object)value;
1121
else if (typeof(TOther) == typeof(
Int128
))
1123
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (10)
54
public static
Int128
BigMul(long left, long right) => Math.BigMul(left, right);
946
else if (typeof(TOther) == typeof(
Int128
))
948
Int128
actualValue = (
Int128
)(object)value;
1028
else if (typeof(TOther) == typeof(
Int128
))
1030
Int128
actualValue = (
Int128
)(object)value;
1116
else if (typeof(TOther) == typeof(
Int128
))
1118
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (10)
190
Int128
result = long.BigMul(left, right);
965
else if (typeof(TOther) == typeof(
Int128
))
967
Int128
actualValue = (
Int128
)(object)value;
1048
else if (typeof(TOther) == typeof(
Int128
))
1050
Int128
actualValue = (
Int128
)(object)value;
1136
else if (typeof(TOther) == typeof(
Int128
))
1138
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
295
public static
Int128
BigMul(long a, long b)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (24)
1362
public static string FormatInt128(
Int128
value, string? format, IFormatProvider? provider)
1367
return
Int128
.IsPositive(value)
1374
static unsafe string FormatInt128Slow(
Int128
value, string? format, IFormatProvider? provider)
1383
return
Int128
.IsPositive(value)
1423
public static bool TryFormatInt128<TChar>(
Int128
value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
1430
return
Int128
.IsPositive(value)
1437
static unsafe bool TryFormatInt128Slow(
Int128
value, ReadOnlySpan<char> format, IFormatProvider? provider, Span<TChar> destination, out int charsWritten)
1444
return
Int128
.IsPositive(value)
1507
return Int128ToHexStr((
Int128
)value, GetHexBase(fmt), digits);
1511
return UInt128ToBinaryStr((
Int128
)value, digits);
1564
return TryInt128ToHexStr((
Int128
)value, GetHexBase(fmt), digits, destination, out charsWritten);
1568
return TryUInt128ToBinaryStr((
Int128
)value, digits, destination, out charsWritten);
2456
private static unsafe void Int128ToNumber(
Int128
value, ref NumberBuffer number)
2460
if (
Int128
.IsPositive(value))
2488
public static string Int128ToDecStr(
Int128
value)
2490
return
Int128
.IsPositive(value)
2495
private static unsafe string NegativeInt128ToDecStr(
Int128
value, int digits, string sNegative)
2497
Debug.Assert(
Int128
.IsNegative(value));
2522
private static unsafe bool TryNegativeInt128ToDecStr<TChar>(
Int128
value, int digits, ReadOnlySpan<TChar> sNegative, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
2525
Debug.Assert(
Int128
.IsNegative(value));
2556
private static unsafe string Int128ToHexStr(
Int128
value, char hexBase, int digits)
2575
private static unsafe bool TryInt128ToHexStr<TChar>(
Int128
value, char hexBase, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
2619
private static unsafe string UInt128ToBinaryStr(
Int128
value, int digits)
2638
private static unsafe bool TryUInt128ToBinaryStr<TChar>(
Int128
value, int digits, Span<TChar> destination, out int charsWritten) where TChar : unmanaged, IUtfChar<TChar>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (20)
577
/// <summary>Explicitly converts a <see cref="
Int128
" /> value to its nearest representable <see cref="BFloat16"/> value.</summary>
580
public static explicit operator BFloat16(
Int128
value) => RoundFromSigned(value);
712
/// <summary>Explicitly converts a <see cref="BFloat16" /> value to its nearest representable <see cref="
Int128
"/>.</summary>
715
public static explicit operator
Int128
(BFloat16 value) => (
Int128
)(double)(value);
717
/// <summary>Explicitly converts a <see cref="BFloat16" /> value to its nearest representable <see cref="
Int128
"/>, throwing an overflow exception for any values that fall outside the representable range.</summary>
720
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
721
public static explicit operator checked
Int128
(BFloat16 value) => checked((
Int128
)(double)(value));
1616
else if (typeof(TOther) == typeof(
Int128
))
1618
Int128
actualValue = (
Int128
)(object)value;
1732
else if (typeof(TOther) == typeof(
Int128
))
1734
Int128
actualResult = checked((
Int128
)value);
1866
else if (typeof(TOther) == typeof(
Int128
))
1868
Int128
actualResult = ((float)value >= +170141183460469231731687303715884105727.0f) ?
Int128
.MaxValue :
1869
((float)value <= -170141183460469231731687303715884105728.0f) ?
Int128
.MinValue : (
Int128
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
322
typeof(T) == typeof(
Int128
) ||
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (23)
328
/// <summary>Explicitly converts a native-sized floating-point value to its nearest representable <see cref="
Int128
" /> value.</summary>
330
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="
Int128
" /> value.</returns>
332
public static explicit operator
Int128
(NFloat value) => (
Int128
)(value._value);
334
/// <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>
336
/// <returns><paramref name="value" /> converted to its nearest representable <see cref="
Int128
" /> value.</returns>
337
/// <exception cref="OverflowException"><paramref name="value" /> is not representable by <see cref="
Int128
" />.</exception>
339
public static explicit operator checked
Int128
(NFloat value) => checked((
Int128
)(value._value));
490
/// <summary>Explicitly converts a <see cref="
Int128
" /> to its nearest representable native-sized floating-point value.</summary>
494
public static explicit operator NFloat(
Int128
value)
496
if (
Int128
.IsNegative(value))
1392
else if (typeof(TOther) == typeof(
Int128
))
1394
Int128
actualValue = (
Int128
)(object)value;
1505
else if (typeof(TOther) == typeof(
Int128
))
1507
Int128
actualResult = checked((
Int128
)value);
1639
else if (typeof(TOther) == typeof(
Int128
))
1641
Int128
actualResult = (value >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
1642
(value <= -170141183460469231731687303715884105728.0) ?
Int128
.MinValue : (
Int128
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (9)
892
else if (typeof(TOther) == typeof(
Int128
))
894
Int128
actualValue = (
Int128
)(object)value;
969
else if (typeof(TOther) == typeof(
Int128
))
971
Int128
actualValue = (
Int128
)(object)value;
1046
else if (typeof(TOther) == typeof(
Int128
))
1048
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (3)
1313
else if (typeof(TOther) == typeof(
Int128
))
1315
Int128
actualValue = (
Int128
)(object)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (6)
473
Int128
totalMicroseconds = Math.BigMul(days, MicrosecondsPerDay)
509
Int128
totalMicroseconds = Math.BigMul(hours, MicrosecondsPerHour)
543
Int128
totalMicroseconds = Math.BigMul(minutes, MicrosecondsPerMinute)
575
Int128
totalMicroseconds = Math.BigMul(seconds, MicrosecondsPerSecond)
606
Int128
totalMicroseconds = Math.BigMul(milliseconds, MicrosecondsPerMillisecond)
613
private static TimeSpan FromMicroseconds(
Int128
microseconds)
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (16)
344
/// <summary>Explicitly converts a 128-bit unsigned integer to a <see cref="
Int128
" /> value.</summary>
346
/// <returns><paramref name="value" /> converted to a <see cref="
Int128
" />.</returns>
348
public static explicit operator
Int128
(UInt128 value) => new Int128(value._upper, value._lower);
350
/// <summary>Explicitly converts a 128-bit unsigned integer to a <see cref="
Int128
" /> value, throwing an overflow exception for any values that fall outside the representable range.</summary>
352
/// <returns><paramref name="value" /> converted to a <see cref="
Int128
" />.</returns>
355
public static explicit operator checked
Int128
(UInt128 value)
1849
else if (typeof(TOther) == typeof(
Int128
))
1851
Int128
actualResult = checked((
Int128
)value);
1923
else if (typeof(TOther) == typeof(
Int128
))
1925
Int128
actualResult = (value >= new UInt128(0x7FFF_FFFF_FFFF_FFFF, 0xFFFF_FFFF_FFFF_FFFF)) ?
Int128
.MaxValue : (
Int128
)value;
2003
else if (typeof(TOther) == typeof(
Int128
))
2005
Int128
actualResult = (
Int128
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (6)
933
else if (typeof(TOther) == typeof(
Int128
))
935
Int128
actualResult = value;
1007
else if (typeof(TOther) == typeof(
Int128
))
1009
Int128
actualResult = value;
1081
else if (typeof(TOther) == typeof(
Int128
))
1083
Int128
actualResult = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (6)
998
else if (typeof(TOther) == typeof(
Int128
))
1000
Int128
actualResult = value;
1072
else if (typeof(TOther) == typeof(
Int128
))
1074
Int128
actualResult = value;
1152
else if (typeof(TOther) == typeof(
Int128
))
1154
Int128
actualResult = value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (8)
1005
else if (typeof(TOther) == typeof(
Int128
))
1007
Int128
actualResult = checked((
Int128
)value);
1079
else if (typeof(TOther) == typeof(
Int128
))
1081
Int128
actualResult = value;
1153
else if (typeof(TOther) == typeof(
Int128
))
1155
Int128
actualResult = (
Int128
)value;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (6)
994
else if (typeof(TOther) == typeof(
Int128
))
996
Int128
actualResult = value;
1068
else if (typeof(TOther) == typeof(
Int128
))
1070
Int128
actualResult = value;
1142
else if (typeof(TOther) == typeof(
Int128
))
1144
Int128
actualResult = value;
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
281
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.
Int128
))]
System.Runtime.Numerics (65)
System\Numerics\BigInteger.cs (33)
2013
return checked((decimal)(
Int128
)value);
2141
/// <summary>Explicitly converts a big integer to a <see cref="
Int128
" /> value.</summary>
2143
/// <returns><paramref name="value" /> converted to <see cref="
Int128
" /> value.</returns>
2144
public static explicit operator
Int128
(BigInteger value)
2179
Int128
ll = (value._sign > 0) ? (
Int128
)uu : -(
Int128
)uu;
2339
/// <summary>Implicitly converts a <see cref="
Int128
" /> value to a big integer.</summary>
2342
public static implicit operator BigInteger(
Int128
value)
4137
else if (typeof(TOther) == typeof(
Int128
))
4139
Int128
actualValue = (
Int128
)(object)value;
4260
else if (typeof(TOther) == typeof(
Int128
))
4262
Int128
actualValue = (
Int128
)(object)value;
4383
else if (typeof(TOther) == typeof(
Int128
))
4385
Int128
actualValue = (
Int128
)(object)value;
4502
else if (typeof(TOther) == typeof(
Int128
))
4504
Int128
actualResult = checked((
Int128
)value);
4673
else if (typeof(TOther) == typeof(
Int128
))
4675
Int128
actualResult = (value >=
Int128
.MaxValue) ?
Int128
.MaxValue :
4676
(value <=
Int128
.MinValue) ?
Int128
.MinValue : (
Int128
)value;
4915
else if (typeof(TOther) == typeof(
Int128
))
4917
Int128
actualResult;
4962
actualResult = (
Int128
)bits;
4966
actualResult = (
Int128
)(long)value._sign;
5160
actualResult = (UInt128)(
Int128
)(long)value._sign;
System\Numerics\BigIntegerCalculator.GcdInv.cs (7)
438
Int128
xCarry = 0, yCarry = 0;
441
Int128
xDigit = a * (
Int128
)x[i] - b * (
Int128
)y[i] + xCarry;
442
Int128
yDigit = d * (
Int128
)y[i] - c * (
Int128
)x[i] + yCarry;
System\Numerics\BigIntegerCalculator.SquMul.cs (7)
885
Int128
carry = 0;
889
Int128
digit = (
Int128
)(ulong)core[i] + carry - (ulong)left[i] - (ulong)right[i];
896
Int128
digit = (
Int128
)(ulong)core[i] + carry - (ulong)left[i];
903
Int128
digit = (
Int128
)(ulong)core[i] + carry;
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)
1573
else if (typeof(TOther) == typeof(
Int128
))
1575
Int128
actualValue = (
Int128
)(object)value;
1727
else if (typeof(TOther) == typeof(
Int128
))
1734
Int128
actualResult = checked((
Int128
)value.m_real);
1914
else if (typeof(TOther) == typeof(
Int128
))
1916
Int128
actualResult = (value.m_real >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
1917
(value.m_real <= -170141183460469231731687303715884105728.0) ?
Int128
.MinValue : (
Int128
)value.m_real;
2056
else if (typeof(TOther) == typeof(
Int128
))
2058
Int128
actualResult = (value.m_real >= +170141183460469231731687303715884105727.0) ?
Int128
.MaxValue :
2059
(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)
36
public override void Write(Utf8JsonWriter writer,
Int128
value, JsonSerializerOptions options)
47
private static unsafe
Int128
ReadCore(ref Utf8JsonReader reader)
57
if (!
Int128
.TryParse(buffer.Slice(0, written), CultureInfo.InvariantCulture, out
Int128
result))
70
private static unsafe void WriteCore(Utf8JsonWriter writer,
Int128
value)
77
internal override
Int128
ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
83
internal override unsafe void WriteAsPropertyNameCore(Utf8JsonWriter writer,
Int128
value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
90
internal override
Int128
ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
106
internal override unsafe void WriteNumberWithCustomHandling(Utf8JsonWriter writer,
Int128
value, JsonNumberHandling handling)
133
Int128
value, out int written)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
117
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="
Int128
"/> values.
120
public static JsonConverter<
Int128
> Int128Converter => s_int128Converter ??= new Int128Converter();
121
private static JsonConverter<
Int128
>? s_int128Converter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
730
potentialNumberType == typeof(
Int128
) ||