95 instantiations of BigInteger
Microsoft.CodeAnalysis (2)
RealParser.cs (2)
62
private static readonly BigInteger s_bigTwo = new
BigInteger
(2);
63
private static readonly BigInteger s_bigTen = new
BigInteger
(10);
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
100
P10 = new
BigInteger
(3.1415),
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnDecoder.Integer.cs (1)
108
BigInteger value = new
BigInteger
(contents, isBigEndian: true);
System\Formats\Asn1\AsnDecoder.Oid.cs (1)
225
largeValue = new
BigInteger
(tmpBytes);
System.Formats.Cbor (1)
System\Formats\Cbor\CborHelpers.netcoreapp.cs (1)
16
=> new
BigInteger
(bytes, isUnsigned: true, isBigEndian: true);
System.Runtime.Numerics (81)
System\Number.BigInteger.cs (6)
227
result = new
BigInteger
((int)signedLeading, null);
237
result = new
BigInteger
((int)signBits | 1, [(leading ^ signBits) - signBits]);
243
result = new
BigInteger
(-1, [0, 1]);
290
result = new
BigInteger
(-1, bits);
298
result = new
BigInteger
(1, bits);
414
result = new
BigInteger
(resultBuffer, number.IsNegative);
System\Numerics\BigInteger.cs (75)
59
private static readonly BigInteger s_int32MinValue =
new
(-1, [UInt32HighBit]);
60
private static readonly BigInteger s_one =
new
(1);
61
private static readonly BigInteger s_zero =
new
(0);
62
private static readonly BigInteger s_minusOne =
new
(-1);
866
return new
BigInteger
((int)NumericsHelpers.Abs(value._sign), value._bits);
927
return new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
947
remainder =
new
(rest, dividend._sign < 0);
948
BigInteger result =
new
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
1044
: new
BigInteger
(+1, right._bits);
1052
: new
BigInteger
(+1, left._bits);
1091
result = new
BigInteger
(bits, negative: false);
1151
result = new
BigInteger
(bits, value._sign < 0 && !exponent.IsEven);
1199
result = new
BigInteger
(bits, value._sign < 0 && (exponent & 1) != 0);
1208
result = new
BigInteger
(bits, value._sign < 0 && (exponent & 1) != 0);
1888
result = new
BigInteger
(bits, leftSign < 0);
1899
result = new
BigInteger
(bits, leftSign < 0);
1910
result = new
BigInteger
(bits, leftSign < 0);
1921
result = new
BigInteger
(bits, leftSign < 0);
1957
result = new
BigInteger
(bits, leftSign >= 0);
1968
result = new
BigInteger
(bits, leftSign < 0);
1977
result = new
BigInteger
(bits, leftSign >= 0);
1988
result = new
BigInteger
(bits, leftSign < 0);
2293
public static explicit operator BigInteger(decimal value) => new
BigInteger
(value);
2295
public static explicit operator BigInteger(double value) => new
BigInteger
(value);
2300
public static explicit operator BigInteger(Half value) => new
BigInteger
((float)value);
2305
public static explicit operator BigInteger(BFloat16 value) => new
BigInteger
((float)value);
2320
public static explicit operator BigInteger(float value) => new
BigInteger
(value);
2326
public static implicit operator BigInteger(byte value) => new
BigInteger
(value);
2331
public static implicit operator BigInteger(char value) => new
BigInteger
(value);
2333
public static implicit operator BigInteger(short value) => new
BigInteger
(value);
2335
public static implicit operator BigInteger(int value) => new
BigInteger
(value);
2337
public static implicit operator BigInteger(long value) => new
BigInteger
(value);
2404
return new
BigInteger
(sign, bits);
2410
public static implicit operator BigInteger(nint value) => new
BigInteger
(value);
2413
public static implicit operator BigInteger(sbyte value) => new
BigInteger
(value);
2416
public static implicit operator BigInteger(ushort value) => new
BigInteger
(value);
2419
public static implicit operator BigInteger(uint value) => new
BigInteger
(value);
2422
public static implicit operator BigInteger(ulong value) => new
BigInteger
(value);
2473
return new
BigInteger
(sign, bits);
2480
public static implicit operator BigInteger(nuint value) => value <= int.MaxValue ? new
BigInteger
((int)value, null) : new
BigInteger
(+1, [value]);
2559
BigInteger result =
new
(z);
2621
return new
BigInteger
(value._sign, z);
2644
return new
BigInteger
(value >= 0 ? (int)r : -(int)r, null);
2657
return new
BigInteger
(value > 0 ? 1 : -1, rgu);
2689
return new
BigInteger
(value._sign >> smallShift, null);
2700
return new
BigInteger
(value._sign >> 31, null);
2721
BigInteger result =
new
(zd, neg);
2746
result = new
BigInteger
(bits, negative: true);
2755
result = new
BigInteger
(bits, negative: false);
2762
public static BigInteger operator -(BigInteger value) => new
BigInteger
(-value._sign, value._bits);
2781
result = new
BigInteger
(bits, negative: false);
2789
result = new
BigInteger
(bits, negative: true);
2810
result = new
BigInteger
(bits, negative: false);
2819
result = new
BigInteger
(bits, negative: true);
2860
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2871
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2880
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2891
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2925
BigInteger result = new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2944
BigInteger result =
new
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2987
BigInteger result =
new
(bits, dividend._sign < 0);
3262
? new
BigInteger
((nint)rs)
3263
: new
BigInteger
(rs);
3283
? new
BigInteger
((nint)rs)
3284
: new
BigInteger
(rs);
3336
BigInteger result =
new
(zd, negative);
3372
value = new
BigInteger
(source, isUnsigned, isBigEndian: true);
3379
value = new
BigInteger
(source, isUnsigned, isBigEndian: false);
5024
return new
BigInteger
((nint)value._sign >>> smallShift);
5065
return new
BigInteger
(nint.MinValue >>> smallShift);
5070
return new
BigInteger
(smallShift == 0 ? -1 : +1, rgu);
5113
result = new
BigInteger
(zd, true);
5117
result = new
BigInteger
(zd, false);
5125
return new
BigInteger
(value._sign >> 31, null);
System.Security.Cryptography (4)
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (1)
43
x = new
BigInteger
(xSpan, isUnsigned: true, isBigEndian: true);
System\Security\Cryptography\X509Certificates\FindPal.cs (2)
95
BigInteger hexValue = new
BigInteger
(hexBytes, isUnsigned: true, isBigEndian: true);
245
BigInteger ten = new
BigInteger
(10);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (1)
106
BigInteger serialNumber = new
BigInteger
(serialBytes, isUnsigned: true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
183
=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new
BigInteger
(alg)));
System.Security.Cryptography.Pkcs (2)
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
244
BigInteger val = new
BigInteger
(
252
val = new
BigInteger
(
System.Security.Cryptography.Xml (1)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (1)
171
h = new
BigInteger
(bytes);
660 references to BigInteger
Microsoft.AspNetCore.Http.Extensions (4)
src\Shared\ParameterBindingMethodCache.cs (4)
672
else if (type == typeof(
BigInteger
))
674
method = typeof(
BigInteger
).GetMethod(
675
nameof(
BigInteger
.TryParse),
677
new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(
BigInteger
).MakeByRefType() });
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\Shared\ParameterBindingMethodCache.cs (4)
672
else if (type == typeof(
BigInteger
))
674
method = typeof(
BigInteger
).GetMethod(
675
nameof(
BigInteger
.TryParse),
677
new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(
BigInteger
).MakeByRefType() });
Microsoft.AspNetCore.OpenApi (4)
src\Shared\ParameterBindingMethodCache.cs (4)
672
else if (type == typeof(
BigInteger
))
674
method = typeof(
BigInteger
).GetMethod(
675
nameof(
BigInteger
.TryParse),
677
new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(
BigInteger
).MakeByRefType() });
Microsoft.CodeAnalysis (25)
RealParser.cs (22)
60
private static readonly
BigInteger
s_bigZero =
BigInteger
.Zero;
61
private static readonly
BigInteger
s_bigOne =
BigInteger
.One;
62
private static readonly
BigInteger
s_bigTwo = new BigInteger(2);
63
private static readonly
BigInteger
s_bigTen = new BigInteger(10);
415
BigInteger
integerValue = AccumulateDecimalDigitsIntoBigInteger(data, integerFirstIndex, integerLastIndex);
465
BigInteger
fractionalNumerator = AccumulateDecimalDigitsIntoBigInteger(data, fractionalFirstIndex, fractionalLastIndex);
468
BigInteger
fractionalDenominator = s_bigOne;
531
BigInteger
fractionalRemainder;
532
BigInteger
bigFractionalMantissa =
BigInteger
.DivRem(fractionalNumerator, fractionalDenominator, out fractionalRemainder);
621
private static
BigInteger
AccumulateDecimalDigitsIntoBigInteger(DecimalFloatingPointString data, uint integer_first_index, uint integer_last_index)
625
return
BigInteger
.Parse(valueString);
661
private static uint CountSignificantBits(
BigInteger
data, out byte[] dataBytes)
682
private static uint CountSignificantBits(
BigInteger
data)
750
private static void ShiftLeft(ref
BigInteger
number, uint shift)
752
var
powerOfTwo =
BigInteger
.Pow(s_bigTwo, (int)shift);
761
private static void MultiplyByPowerOfTen(ref
BigInteger
number, uint power)
763
var
powerOfTen =
BigInteger
.Pow(s_bigTen, (int)power);
VersionHelper.cs (3)
106
System.Numerics.
BigInteger
number = 0;
152
System.Numerics.
BigInteger
number;
153
if (System.Numerics.
BigInteger
.TryParse(s, NumberStyles.None, CultureInfo.InvariantCulture, out number))
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\LogPropertiesSpecialTypesExtensions.cs (1)
27
public
BigInteger
P10 { get; set; }
Microsoft.Gen.Logging.Unit.Tests (3)
CompilationHelper.cs (1)
37
refs.Add(MetadataReference.CreateFromFile(typeof(
BigInteger
).Assembly.Location));
EmitterTests.cs (1)
47
Assembly.GetAssembly(typeof(
BigInteger
))!,
ParserTests.cs (1)
727
Assembly.GetAssembly(typeof(
BigInteger
))!,
Microsoft.ML.Parquet (2)
ParquetLoader.cs (2)
517
return CreateGetterDelegateCore<
BigInteger
, DataViewRowId>(col, _parquetConversions.Conv);
725
public void Conv(in
BigInteger
src, ref DataViewRowId dst)
netstandard (1)
netstandard.cs (1)
1331
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
BigInteger
))]
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (3)
114
System.Numerics.
BigInteger
number = 0;
163
System.Numerics.
BigInteger
number;
164
if (System.Numerics.
BigInteger
.TryParse(s, NumberStyles.None, CultureInfo.InvariantCulture, out number))
System.Data.Common (51)
System\Data\Common\BigIntegerStorage.cs (23)
13
private
BigInteger
[] _values = default!; // Late-initialized
16
base(column, typeof(
BigInteger
),
BigInteger
.Zero, StorageType.BigInteger)
27
BigInteger
valueNo1 = _values[recordNo1];
28
BigInteger
valueNo2 = _values[recordNo2];
52
BigInteger
valueNo1 = _values[recordNo];
58
return valueNo1.CompareTo((
BigInteger
)value);
62
internal static
BigInteger
ConvertToBigInteger(object value, IFormatProvider formatProvider)
64
if (value.GetType() == typeof(
BigInteger
)) { return (
BigInteger
)value; }
65
else if (value.GetType() == typeof(string)) { return
BigInteger
.Parse((string)value, formatProvider); }
74
else { throw ExceptionBuilder.ConvertFailed(value.GetType(), typeof(System.Numerics.
BigInteger
)); }
77
internal static object ConvertFromBigInteger(
BigInteger
value, Type type, IFormatProvider formatProvider)
91
else if (type == typeof(System.Numerics.
BigInteger
)) { return value; }
92
else { throw ExceptionBuilder.ConvertFailed(typeof(System.Numerics.
BigInteger
), type); }
119
BigInteger
value = _values[record];
132
_values[record] =
BigInteger
.Zero;
152
return
BigInteger
.Parse(s, System.Globalization.CultureInfo.InvariantCulture);
159
return ((
BigInteger
)value).ToString("D", System.Globalization.CultureInfo.InvariantCulture);
164
return new
BigInteger
[recordCount];
169
BigInteger
[] typedStore = (
BigInteger
[])store;
176
_values = (
BigInteger
[])store;
System\Data\Common\DataStorage.cs (2)
92
typeof(System.Numerics.
BigInteger
),
579
dataType = typeof(System.Numerics.
BigInteger
);
System\Data\Common\SQLConvert.cs (3)
350
if (type == typeof(System.Numerics.
BigInteger
))
355
else if (value is System.Numerics.
BigInteger
)
357
return BigIntegerStorage.ConvertFromBigInteger((System.Numerics.
BigInteger
)value, type, formatProvider);
System\Data\DataColumn.cs (17)
262
if ((
BigInteger
)AutoIncrementSeed != BigIntegerStorage.ConvertToBigInteger(value, FormatProvider))
270
(_autoInc ??= ((DataType == typeof(
BigInteger
)) ?
512
if (_defaultValue is
BigInteger
)
514
_defaultValue = BigIntegerStorage.ConvertFromBigInteger((
BigInteger
)_defaultValue, value, FormatProvider);
516
else if (typeof(
BigInteger
) == value)
584
AutoInc.Current = (
BigInteger
)(long)inc.Current;
588
AutoInc.Current = checked((long)(
BigInteger
)inc.Current);
1608
dataType == typeof(
BigInteger
) ||
1956
Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is
BigInteger
), "unexpected value for autoincrement");
1964
private bool BoundaryCheck(
BigInteger
value) =>
1972
private
BigInteger
_current;
1978
private
BigInteger
_step = 1;
1984
set { _current = (
BigInteger
)value; }
1987
internal override Type DataType => typeof(
BigInteger
);
2037
BigInteger
v = (
BigInteger
)value;
2044
private bool BoundaryCheck(
BigInteger
value) =>
System\Data\TypeLimiter.cs (1)
170
typeof(
BigInteger
),
System\Data\xmlsaver.cs (5)
87
else if (entry.Value is System.Numerics.
BigInteger
)
89
v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.
BigInteger
)entry.Value, typeof(string), CultureInfo.InvariantCulture);
199
if (bIsSqlType || (col.DataType == typeof(System.Numerics.
BigInteger
)))
265
if (type == typeof(System.Numerics.
BigInteger
))
1348
if ((col.IsSqlType && ((dt.Length == 0) || col.ImplementsINullable)) || (typeof(SqlXml) == col.DataType) || col.DataType == typeof(DateTimeOffset) || col.DataType == typeof(System.Numerics.
BigInteger
))
System.Formats.Asn1 (19)
System\Formats\Asn1\AsnDecoder.Integer.cs (6)
99
public static
BigInteger
ReadInteger(
108
BigInteger
value = new BigInteger(contents, isBigEndian: true);
584
public
BigInteger
ReadInteger(Asn1Tag? expectedTag = null)
586
BigInteger
ret = AsnDecoder.ReadInteger(_data.Span, RuleSet, out int consumed, expectedTag);
814
public
BigInteger
ReadInteger(Asn1Tag? expectedTag = null)
816
BigInteger
ret = AsnDecoder.ReadInteger(_data, RuleSet, out int consumed, expectedTag);
System\Formats\Asn1\AsnDecoder.Oid.cs (3)
83
out
BigInteger
? largeValue)
252
ReadSubIdentifier(contents, out int bytesRead, out long? smallValue, out
BigInteger
? largeValue);
289
BigInteger
firstIdentifier = largeValue.Value;
System\Formats\Asn1\AsnWriter.Integer.cs (2)
60
public void WriteInteger(
BigInteger
value, Asn1Tag? tag = null)
279
private void WriteIntegerCore(Asn1Tag tag,
BigInteger
value)
System\Formats\Asn1\AsnWriter.Oid.cs (8)
116
BigInteger
subIdentifier = ParseSubIdentifier(ref remaining);
147
private static
BigInteger
ParseSubIdentifier(ref ReadOnlySpan<char> oidValue)
160
BigInteger
value =
BigInteger
.Zero;
188
private static int EncodeSubIdentifier(Span<byte> dest, ref
BigInteger
subIdentifier)
198
BigInteger
unencoded = subIdentifier;
203
BigInteger
cur = unencoded & 0x7F;
215
while (unencoded !=
BigInteger
.Zero);
System.Formats.Cbor (7)
System\Formats\Cbor\CborHelpers.netcoreapp.cs (2)
15
public static
BigInteger
CreateBigIntegerFromUnsignedBigEndianBytes(byte[] bytes)
18
public static byte[] CreateUnsignedBigEndianBytesFromBigInteger(
BigInteger
value)
System\Formats\Cbor\Reader\CborReader.Tag.cs (2)
153
public
BigInteger
ReadBigInteger()
178
BigInteger
unsignedValue = CborHelpers.CreateBigIntegerFromUnsignedBigEndianBytes(unsignedBigEndianEncoding);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (3)
88
public void WriteBigInteger(
BigInteger
value)
91
BigInteger
unsignedValue = isUnsigned ? value : -1 - value;
127
WriteBigInteger((
BigInteger
)mantissa);
System.Numerics (1)
System.Numerics.cs (1)
4
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.
BigInteger
))]
System.Runtime.Numerics (497)
System\Number.BigInteger.cs (30)
65
internal static ParsingStatus TryParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out
BigInteger
result)
86
internal static unsafe ParsingStatus TryParseBigIntegerNumber<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out
BigInteger
result)
132
internal static
BigInteger
ParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info)
140
ParsingStatus status = TryParseBigInteger(value, style, info, out
BigInteger
result);
149
internal static ParsingStatus TryParseBigIntegerHexOrBinaryNumberStyle<TParser, TChar>(ReadOnlySpan<TChar> value, NumberStyles style, out
BigInteger
result)
253
if (totalUIntCount >
BigInteger
.MaxLength)
280
if (bits.Length + 1 >
BigInteger
.MaxLength)
328
private static ParsingStatus NumberToBigInteger(ref NumberBuffer number, out
BigInteger
result)
375
base1E9 =
BigInteger
.RentedBuffer.Create(base1E9Length, out
BigInteger
.RentedBuffer base1E9Rental);
400
Span<nuint> resultBuffer =
BigInteger
.RentedBuffer.Create(resultLength, out
BigInteger
.RentedBuffer resultRental);
432
Span<nuint> leading =
BigInteger
.RentedBuffer.Create(leadingLength, out
BigInteger
.RentedBuffer leadingBuffer);
472
scoped Span<nuint> buffer =
BigInteger
.RentedBuffer.Create(bufferLength, out
BigInteger
.RentedBuffer bufferRental);
571
private static string? FormatBigIntegerToHex<TChar>(bool targetSpan,
BigInteger
value, char format, int digits, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess)
657
private static string? FormatBigIntegerToBinary<TChar>(bool targetSpan,
BigInteger
value, int digits, Span<TChar> destination, out int charsWritten, out bool spanSuccess)
760
internal static string FormatBigInteger(
BigInteger
value, string? format, NumberFormatInfo info)
765
internal static bool TryFormatBigInteger<TChar>(
BigInteger
value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten)
772
private static unsafe string? FormatBigInteger<TChar>(bool targetSpan,
BigInteger
value, string? formatString, ReadOnlySpan<char> formatSpan, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess)
833
Debug.Assert(
BigInteger
.MaxLength * digitRatio + 1 < Array.MaxLength); // won't overflow
836
Span<nuint> base1E9Buffer =
BigInteger
.RentedBuffer.Create(base1E9BufferLength, out
BigInteger
.RentedBuffer base1E9Rental);
1026
Span<nuint> upper =
BigInteger
.RentedBuffer.Create(upperLength, out
BigInteger
.RentedBuffer upperBuffer);
1029
Span<nuint> lower =
BigInteger
.RentedBuffer.Create(lowerLength, out
BigInteger
.RentedBuffer lowerBuffer);
1433
Span<nuint> powersOfTen =
BigInteger
.RentedBuffer.Create(bits.Length, out
BigInteger
.RentedBuffer powersOfTenBuffer);
System\Numerics\BigInteger.cs (386)
20
IComparable<
BigInteger
>,
21
IEquatable<
BigInteger
>,
22
IBinaryInteger<
BigInteger
>,
23
ISignedNumber<
BigInteger
>,
35
/// Maximum number of limbs in a <see cref="
BigInteger
"/>. Restricts allocations to ~256MB,
59
private static readonly
BigInteger
s_int32MinValue = new(-1, [UInt32HighBit]);
60
private static readonly
BigInteger
s_one = new(1);
61
private static readonly
BigInteger
s_zero = new(0);
62
private static readonly
BigInteger
s_minusOne = new(-1);
689
/// Initializes a new <see cref="
BigInteger
"/> from serialized data.
725
/// Populates a <see cref="SerializationInfo"/> with the data needed to serialize the <see cref="
BigInteger
"/>.
765
public static
BigInteger
Zero => s_zero;
767
public static
BigInteger
One => s_one;
769
public static
BigInteger
MinusOne => s_minusOne;
798
public static
BigInteger
Parse(string value)
803
public static
BigInteger
Parse(string value, NumberStyles style)
808
public static
BigInteger
Parse(string value, IFormatProvider? provider)
813
public static
BigInteger
Parse(string value, NumberStyles style, IFormatProvider? provider)
819
public static bool TryParse([NotNullWhen(true)] string? value, out
BigInteger
result)
824
public static bool TryParse([NotNullWhen(true)] string? value, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
829
public static
BigInteger
Parse(ReadOnlySpan<char> value, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
834
public static
BigInteger
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
839
public static bool TryParse(ReadOnlySpan<char> value, out
BigInteger
result)
844
public static bool TryParse(ReadOnlySpan<char> value, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
849
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
BigInteger
result)
854
public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
859
public static int Compare(
BigInteger
left,
BigInteger
right)
864
public static
BigInteger
Abs(
BigInteger
value)
869
public static
BigInteger
Add(
BigInteger
left,
BigInteger
right)
874
public static
BigInteger
Subtract(
BigInteger
left,
BigInteger
right)
879
public static
BigInteger
Multiply(
BigInteger
left,
BigInteger
right)
884
public static
BigInteger
Divide(
BigInteger
dividend,
BigInteger
divisor)
889
public static
BigInteger
Remainder(
BigInteger
dividend,
BigInteger
divisor)
894
public static
BigInteger
DivRem(
BigInteger
dividend,
BigInteger
divisor, out
BigInteger
remainder)
901
BigInteger
quotient;
948
BigInteger
result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
957
public static
BigInteger
Negate(
BigInteger
value)
962
public static double Log(
BigInteger
value)
967
public static double Log(
BigInteger
value, double baseValue)
1024
public static double Log10(
BigInteger
value)
1029
public static
BigInteger
GreatestCommonDivisor(
BigInteger
left,
BigInteger
right)
1062
private static
BigInteger
GreatestCommonDivisor(ReadOnlySpan<nuint> leftBits, ReadOnlySpan<nuint> rightBits)
1066
BigInteger
result;
1098
public static
BigInteger
Max(
BigInteger
left,
BigInteger
right)
1103
public static
BigInteger
Min(
BigInteger
left,
BigInteger
right)
1108
public static
BigInteger
ModPow(
BigInteger
value,
BigInteger
exponent,
BigInteger
modulus)
1116
BigInteger
result;
1159
public static
BigInteger
Pow(
BigInteger
value, int exponent)
1176
BigInteger
result;
1230
return obj is
BigInteger
other && Equals(other);
1293
public bool Equals(
BigInteger
other)
1365
public int CompareTo(
BigInteger
other)
1396
obj is
BigInteger
bigInt ? CompareTo(bigInt) :
1871
private static
BigInteger
Add(ReadOnlySpan<nuint> leftBits, int leftSign, ReadOnlySpan<nuint> rightBits, int rightSign)
1878
BigInteger
result;
1928
public static
BigInteger
operator -(
BigInteger
left,
BigInteger
right)
1940
private static
BigInteger
Subtract(ReadOnlySpan<nuint> leftBits, int leftSign, ReadOnlySpan<nuint> rightBits, int rightSign)
1947
BigInteger
result;
1999
public static explicit operator byte(
BigInteger
value) => checked((byte)((int)value));
2004
public static explicit operator char(
BigInteger
value) => checked((char)((int)value));
2006
public static explicit operator decimal(
BigInteger
value)
2016
public static explicit operator double(
BigInteger
value)
2068
public static explicit operator Half(
BigInteger
value) => (Half)(double)value;
2073
public static explicit operator BFloat16(
BigInteger
value) => (BFloat16)(double)value;
2075
public static explicit operator short(
BigInteger
value) => checked((short)((int)value));
2077
public static explicit operator int(
BigInteger
value)
2104
public static explicit operator long(
BigInteger
value)
2144
public static explicit operator Int128(
BigInteger
value)
2193
public static explicit operator nint(
BigInteger
value) => Environment.Is64BitProcess ? (nint)(long)value : (int)value;
2196
public static explicit operator sbyte(
BigInteger
value) => checked((sbyte)((int)value));
2198
public static explicit operator float(
BigInteger
value) => (float)((double)value);
2201
public static explicit operator ushort(
BigInteger
value) => checked((ushort)((int)value));
2204
public static explicit operator uint(
BigInteger
value)
2219
public static explicit operator ulong(
BigInteger
value)
2247
public static explicit operator UInt128(
BigInteger
value)
2287
public static explicit operator nuint(
BigInteger
value) => Environment.Is64BitProcess ? (nuint)(ulong)value : (uint)value;
2293
public static explicit operator
BigInteger
(decimal value) => new BigInteger(value);
2295
public static explicit operator
BigInteger
(double value) => new BigInteger(value);
2300
public static explicit operator
BigInteger
(Half value) => new BigInteger((float)value);
2305
public static explicit operator
BigInteger
(BFloat16 value) => new BigInteger((float)value);
2310
public static explicit operator
BigInteger
(Complex value)
2317
return (
BigInteger
)value.Real;
2320
public static explicit operator
BigInteger
(float value) => new BigInteger(value);
2326
public static implicit operator
BigInteger
(byte value) => new BigInteger(value);
2331
public static implicit operator
BigInteger
(char value) => new BigInteger(value);
2333
public static implicit operator
BigInteger
(short value) => new BigInteger(value);
2335
public static implicit operator
BigInteger
(int value) => new BigInteger(value);
2337
public static implicit operator
BigInteger
(long value) => new BigInteger(value);
2342
public static implicit operator
BigInteger
(Int128 value)
2410
public static implicit operator
BigInteger
(nint value) => new BigInteger(value);
2413
public static implicit operator
BigInteger
(sbyte value) => new BigInteger(value);
2416
public static implicit operator
BigInteger
(ushort value) => new BigInteger(value);
2419
public static implicit operator
BigInteger
(uint value) => new BigInteger(value);
2422
public static implicit operator
BigInteger
(ulong value) => new BigInteger(value);
2428
public static implicit operator
BigInteger
(UInt128 value)
2480
public static implicit operator
BigInteger
(nuint value) => value <= int.MaxValue ? new BigInteger((int)value, null) : new BigInteger(+1, [value]);
2482
public static
BigInteger
operator &(
BigInteger
left,
BigInteger
right) =>
2484
left._bits is null && right._bits is null ? (
BigInteger
)(left._sign & right._sign) :
2487
public static
BigInteger
operator |(
BigInteger
left,
BigInteger
right)
2500
? (
BigInteger
)(left._sign | right._sign)
2504
public static
BigInteger
operator ^(
BigInteger
left,
BigInteger
right) =>
2506
? (
BigInteger
)(left._sign ^ right._sign)
2513
private static
BigInteger
BitwiseAnd(ref readonly
BigInteger
left, ref readonly
BigInteger
right)
2532
private static
BigInteger
BitwiseOr(ref readonly
BigInteger
left, ref readonly
BigInteger
right)
2542
private static
BigInteger
BitwiseXor(ref readonly
BigInteger
left, ref readonly
BigInteger
right)
2549
private static
BigInteger
BitwiseOp<TOp>(ref readonly
BigInteger
left, ref readonly
BigInteger
right, int zLen)
2559
BigInteger
result = new(z);
2566
public static
BigInteger
operator <<(
BigInteger
value, int shift)
2624
private static
BigInteger
LeftShift(int value, int digitShift, int smallShift)
2660
public static
BigInteger
operator >>(
BigInteger
value, int shift)
2721
BigInteger
result = new(zd, neg);
2728
public static
BigInteger
operator ~(
BigInteger
value)
2737
BigInteger
result;
2762
public static
BigInteger
operator -(
BigInteger
value) => new BigInteger(-value._sign, value._bits);
2764
public static
BigInteger
operator +(
BigInteger
value) => value;
2766
public static
BigInteger
operator ++(
BigInteger
value)
2773
BigInteger
result;
2796
public static
BigInteger
operator --(
BigInteger
value)
2803
BigInteger
result;
2826
public static
BigInteger
operator +(
BigInteger
left,
BigInteger
right)
2838
public static
BigInteger
operator *(
BigInteger
left,
BigInteger
right) =>
2840
? (
BigInteger
)((long)left._sign * right._sign)
2843
private static
BigInteger
Multiply(ReadOnlySpan<nuint> left, int leftSign, ReadOnlySpan<nuint> right, int rightSign)
2850
BigInteger
result;
2898
public static
BigInteger
operator /(
BigInteger
dividend,
BigInteger
divisor)
2925
BigInteger
result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2944
BigInteger
result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2952
public static
BigInteger
operator %(
BigInteger
dividend,
BigInteger
divisor)
2987
BigInteger
result = new(bits, dividend._sign < 0);
2994
public static bool operator <(
BigInteger
left,
BigInteger
right) => left.CompareTo(right) < 0;
2996
public static bool operator <=(
BigInteger
left,
BigInteger
right) => left.CompareTo(right) <= 0;
2998
public static bool operator >(
BigInteger
left,
BigInteger
right) => left.CompareTo(right) > 0;
3000
public static bool operator >=(
BigInteger
left,
BigInteger
right) => left.CompareTo(right) >= 0;
3002
public static bool operator ==(
BigInteger
left,
BigInteger
right) => left.Equals(right);
3004
public static bool operator !=(
BigInteger
left,
BigInteger
right) => !left.Equals(right);
3006
public static bool operator <(
BigInteger
left, long right) => left.CompareTo(right) < 0;
3008
public static bool operator <=(
BigInteger
left, long right) => left.CompareTo(right) <= 0;
3010
public static bool operator >(
BigInteger
left, long right) => left.CompareTo(right) > 0;
3012
public static bool operator >=(
BigInteger
left, long right) => left.CompareTo(right) >= 0;
3014
public static bool operator ==(
BigInteger
left, long right) => left.Equals(right);
3016
public static bool operator !=(
BigInteger
left, long right) => !left.Equals(right);
3018
public static bool operator <(long left,
BigInteger
right) => right.CompareTo(left) > 0;
3020
public static bool operator <=(long left,
BigInteger
right) => right.CompareTo(left) >= 0;
3022
public static bool operator >(long left,
BigInteger
right) => right.CompareTo(left) < 0;
3024
public static bool operator >=(long left,
BigInteger
right) => right.CompareTo(left) <= 0;
3026
public static bool operator ==(long left,
BigInteger
right) => right.Equals(left);
3028
public static bool operator !=(long left,
BigInteger
right) => !right.Equals(left);
3031
public static bool operator <(
BigInteger
left, ulong right) => left.CompareTo(right) < 0;
3034
public static bool operator <=(
BigInteger
left, ulong right) => left.CompareTo(right) <= 0;
3037
public static bool operator >(
BigInteger
left, ulong right) => left.CompareTo(right) > 0;
3040
public static bool operator >=(
BigInteger
left, ulong right) => left.CompareTo(right) >= 0;
3043
public static bool operator ==(
BigInteger
left, ulong right) => left.Equals(right);
3046
public static bool operator !=(
BigInteger
left, ulong right) => !left.Equals(right);
3049
public static bool operator <(ulong left,
BigInteger
right) => right.CompareTo(left) > 0;
3052
public static bool operator <=(ulong left,
BigInteger
right) => right.CompareTo(left) >= 0;
3055
public static bool operator >(ulong left,
BigInteger
right) => right.CompareTo(left) < 0;
3058
public static bool operator >=(ulong left,
BigInteger
right) => right.CompareTo(left) <= 0;
3061
public static bool operator ==(ulong left,
BigInteger
right) => right.Equals(left);
3064
public static bool operator !=(ulong left,
BigInteger
right) => !right.Equals(left);
3137
static
BigInteger
IAdditiveIdentity<
BigInteger
,
BigInteger
>.AdditiveIdentity => Zero;
3144
static
BigInteger
IBinaryInteger<
BigInteger
>.Log10(
BigInteger
value)
3166
BigInteger
log2Value = Log2(value);
3167
BigInteger
approx = ((log2Value + 1) * 1292913986L) >> 32;
3168
BigInteger
power = Pow(10, (int)approx);
3174
public static (
BigInteger
Quotient,
BigInteger
Remainder) DivRem(
BigInteger
left,
BigInteger
right)
3176
BigInteger
quotient = DivRem(left, right, out
BigInteger
remainder);
3181
public static
BigInteger
LeadingZeroCount(
BigInteger
value)
3197
public static
BigInteger
PopCount(
BigInteger
value)
3249
public static
BigInteger
RotateLeft(
BigInteger
value, int rotateAmount)
3270
public static
BigInteger
RotateRight(
BigInteger
value, int rotateAmount)
3290
private static
BigInteger
Rotate(ReadOnlySpan<nuint> bits, bool negative, long rotateLeftAmount)
3336
BigInteger
result = new(zd, negative);
3344
public static
BigInteger
TrailingZeroCount(
BigInteger
value)
3370
static bool IBinaryInteger<
BigInteger
>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
BigInteger
value)
3377
static bool IBinaryInteger<
BigInteger
>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
BigInteger
value)
3384
int IBinaryInteger<
BigInteger
>.GetShortestBitLength()
3421
int IBinaryInteger<
BigInteger
>.GetByteCount() => GetGenericMathByteCount();
3424
bool IBinaryInteger<
BigInteger
>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten)
3502
bool IBinaryInteger<
BigInteger
>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
3617
static
BigInteger
IBinaryNumber<
BigInteger
>.AllBitsSet => MinusOne;
3620
public static bool IsPow2(
BigInteger
value) => value.IsPowerOfTwo;
3623
public static
BigInteger
Log2(
BigInteger
value)
3631
? (
BigInteger
)((BigIntegerCalculator.BitsPerLimb - 1) ^ BitOperations.LeadingZeroCount((nuint)value._sign | 1))
3632
: (
BigInteger
)(((long)value._bits.Length * BigIntegerCalculator.BitsPerLimb - 1) ^ BitOperations.LeadingZeroCount(value._bits[^1]));
3640
static
BigInteger
IMultiplicativeIdentity<
BigInteger
,
BigInteger
>.MultiplicativeIdentity => One;
3647
public static
BigInteger
Clamp(
BigInteger
value,
BigInteger
min,
BigInteger
max)
3673
public static
BigInteger
CopySign(
BigInteger
value,
BigInteger
sign)
3693
static
BigInteger
INumber<
BigInteger
>.MaxNumber(
BigInteger
x,
BigInteger
y) => Max(x, y);
3696
static
BigInteger
INumber<
BigInteger
>.MinNumber(
BigInteger
x,
BigInteger
y) => Min(x, y);
3699
static int INumber<
BigInteger
>.Sign(
BigInteger
value)
3711
static int INumberBase<
BigInteger
>.Radix => 2;
3715
public static
BigInteger
CreateChecked<TOther>(TOther value)
3718
BigInteger
result;
3720
if (typeof(TOther) == typeof(
BigInteger
))
3722
result = (
BigInteger
)(object)value;
3734
public static
BigInteger
CreateSaturating<TOther>(TOther value)
3737
BigInteger
result;
3739
if (typeof(TOther) == typeof(
BigInteger
))
3741
result = (
BigInteger
)(object)value;
3753
public static
BigInteger
CreateTruncating<TOther>(TOther value)
3756
BigInteger
result;
3758
if (typeof(TOther) == typeof(
BigInteger
))
3760
result = (
BigInteger
)(object)value;
3771
static bool INumberBase<
BigInteger
>.IsCanonical(
BigInteger
value) => true;
3774
static bool INumberBase<
BigInteger
>.IsComplexNumber(
BigInteger
value) => false;
3777
public static bool IsEvenInteger(
BigInteger
value)
3785
static bool INumberBase<
BigInteger
>.IsFinite(
BigInteger
value) => true;
3788
static bool INumberBase<
BigInteger
>.IsImaginaryNumber(
BigInteger
value) => false;
3791
static bool INumberBase<
BigInteger
>.IsInfinity(
BigInteger
value) => false;
3794
static bool INumberBase<
BigInteger
>.IsInteger(
BigInteger
value) => true;
3797
static bool INumberBase<
BigInteger
>.IsNaN(
BigInteger
value) => false;
3800
public static bool IsNegative(
BigInteger
value)
3806
static bool INumberBase<
BigInteger
>.IsNegativeInfinity(
BigInteger
value) => false;
3809
static bool INumberBase<
BigInteger
>.IsNormal(
BigInteger
value) => (value != 0);
3812
public static bool IsOddInteger(
BigInteger
value)
3820
public static bool IsPositive(
BigInteger
value)
3826
static bool INumberBase<
BigInteger
>.IsPositiveInfinity(
BigInteger
value) => false;
3829
static bool INumberBase<
BigInteger
>.IsRealNumber(
BigInteger
value) => true;
3832
static bool INumberBase<
BigInteger
>.IsSubnormal(
BigInteger
value) => false;
3835
static bool INumberBase<
BigInteger
>.IsZero(
BigInteger
value)
3841
public static
BigInteger
MaxMagnitude(
BigInteger
x,
BigInteger
y)
3848
static
BigInteger
INumberBase<
BigInteger
>.MaxMagnitudeNumber(
BigInteger
x,
BigInteger
y) => MaxMagnitude(x, y);
3851
public static
BigInteger
MinMagnitude(
BigInteger
x,
BigInteger
y)
3858
static
BigInteger
INumberBase<
BigInteger
>.MinMagnitudeNumber(
BigInteger
x,
BigInteger
y) => MinMagnitude(x, y);
3861
static
BigInteger
INumberBase<
BigInteger
>.MultiplyAddEstimate(
BigInteger
left,
BigInteger
right,
BigInteger
addend) => (left * right) + addend;
3865
static bool INumberBase<
BigInteger
>.TryConvertFromChecked<TOther>(TOther value, out
BigInteger
result) => TryConvertFromChecked(value, out result);
3868
private static bool TryConvertFromChecked<TOther>(TOther value, out
BigInteger
result)
3886
result = (
BigInteger
)actualValue;
3892
result = checked((
BigInteger
)actualValue);
3898
result = checked((
BigInteger
)actualValue);
3904
result = checked((
BigInteger
)actualValue);
3946
result = checked((
BigInteger
)actualValue);
3988
static bool INumberBase<
BigInteger
>.TryConvertFromSaturating<TOther>(TOther value, out
BigInteger
result) => TryConvertFromSaturating(value, out result);
3991
private static bool TryConvertFromSaturating<TOther>(TOther value, out
BigInteger
result)
4009
result = (
BigInteger
)actualValue;
4015
result = double.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4021
result = Half.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4027
result = BFloat16.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4069
result = float.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4111
static bool INumberBase<
BigInteger
>.TryConvertFromTruncating<TOther>(TOther value, out
BigInteger
result) => TryConvertFromTruncating(value, out result);
4114
private static bool TryConvertFromTruncating<TOther>(TOther value, out
BigInteger
result)
4132
result = (
BigInteger
)actualValue;
4138
result = double.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4144
result = Half.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4150
result = BFloat16.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4192
result = float.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4234
static bool INumberBase<
BigInteger
>.TryConvertToChecked<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
4359
static bool INumberBase<
BigInteger
>.TryConvertToSaturating<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
4558
static bool INumberBase<
BigInteger
>.TryConvertToTruncating<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
4989
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
BigInteger
result) => TryParse(s, NumberStyles.Integer, provider, out result);
4996
public static
BigInteger
operator >>>(
BigInteger
value, int shiftAmount)
5105
BigInteger
result;
5132
static
BigInteger
ISignedNumber<
BigInteger
>.NegativeOne => MinusOne;
5139
public static
BigInteger
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider);
5142
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
BigInteger
result) => TryParse(s, NumberStyles.Integer, provider, out result);
5149
public static
BigInteger
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Integer, provider);
5152
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
BigInteger
result) => TryParse(utf8Text, NumberStyles.Integer, provider, out result);
System\Numerics\BigInteger.RentedBuffer.cs (1)
14
/// Provides temporary buffer management for <see cref="
BigInteger
"/> operations, using either stack-allocated inline storage or pooled arrays depending on size requirements.
System\Numerics\BigIntegerCalculator.DivRem.cs (24)
99
Span<nuint> leftCopy =
BigInteger
.RentedBuffer.Create(left.Length, out
BigInteger
.RentedBuffer leftCopyBuffer);
131
Span<nuint> quotient =
BigInteger
.RentedBuffer.Create(quotientLength, out
BigInteger
.RentedBuffer quotientBuffer);
163
Span<nuint> leftCopy =
BigInteger
.RentedBuffer.Create(left.Length, out
BigInteger
.RentedBuffer leftCopyBuffer);
167
Span<nuint> quotientAllocated =
BigInteger
.RentedBuffer.Create(quotientLength, out
BigInteger
.RentedBuffer quotientActualBuffer);
336
Span<nuint> b =
BigInteger
.RentedBuffer.Create(n, out
BigInteger
.RentedBuffer bBuffer);
349
Span<nuint> a =
BigInteger
.RentedBuffer.Create(aLength, out
BigInteger
.RentedBuffer aBuffer);
385
Span<nuint> r =
BigInteger
.RentedBuffer.Create(n + 1, out
BigInteger
.RentedBuffer rBuffer);
387
Span<nuint> z =
BigInteger
.RentedBuffer.Create(2 * n, out
BigInteger
.RentedBuffer zBuffer);
394
Span<nuint> q =
BigInteger
.RentedBuffer.Create(n, out
BigInteger
.RentedBuffer qBuffer);
501
Span<nuint> r1 =
BigInteger
.RentedBuffer.Create(left.Length, out
BigInteger
.RentedBuffer r1Buffer);
541
Span<nuint> r1 =
BigInteger
.RentedBuffer.Create(right.Length + 1, out
BigInteger
.RentedBuffer r1Buffer);
566
Span<nuint> d =
BigInteger
.RentedBuffer.Create(right.Length, out
BigInteger
.RentedBuffer dBuffer);
System\Numerics\BigIntegerCalculator.GcdInv.cs (2)
97
Span<nuint> rightCopy =
BigInteger
.RentedBuffer.Create(right.Length, out
BigInteger
.RentedBuffer rightCopyBuffer);
System\Numerics\BigIntegerCalculator.PowMod.cs (30)
25
Span<nuint> temp =
BigInteger
.RentedBuffer.Create(bits.Length, out
BigInteger
.RentedBuffer tempBuffer);
27
Span<nuint> valueCopy =
BigInteger
.RentedBuffer.Create(bits.Length, out
BigInteger
.RentedBuffer valueCopyBuffer);
267
Span<nuint> valueCopy =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer valueCopyBuffer);
283
Span<nuint> temp =
BigInteger
.RentedBuffer.Create(bits.Length, out
BigInteger
.RentedBuffer tempBuffer);
307
Span<nuint> valueCopy =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer valueCopyBuffer);
323
Span<nuint> temp =
BigInteger
.RentedBuffer.Create(bits.Length, out
BigInteger
.RentedBuffer tempBuffer);
392
Span<nuint> r =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer rBuffer);
395
Span<nuint> mu =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer muBuffer);
398
Span<nuint> q1 =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer q1Buffer);
400
Span<nuint> q2 =
BigInteger
.RentedBuffer.Create(size, out
BigInteger
.RentedBuffer q2Buffer);
496
Span<nuint> shifted =
BigInteger
.RentedBuffer.Create(shiftLen, out
BigInteger
.RentedBuffer shiftedBuffer);
511
Span<nuint> rModN =
BigInteger
.RentedBuffer.Create(k, out
BigInteger
.RentedBuffer rModNBuffer);
514
Span<nuint> oneShifted =
BigInteger
.RentedBuffer.Create(oneShiftLen, out
BigInteger
.RentedBuffer oneShiftedBuffer);
563
Span<nuint> prod =
BigInteger
.RentedBuffer.Create(bufLen, out
BigInteger
.RentedBuffer prodBuffer);
566
Span<nuint> base2 =
BigInteger
.RentedBuffer.Create(k, out
BigInteger
.RentedBuffer base2Buffer);
System\Numerics\BigIntegerCalculator.ShiftRot.cs (2)
84
Span<nuint> tmp =
BigInteger
.RentedBuffer.Create(tmpLength, out
BigInteger
.RentedBuffer tmpBuffer);
System\Numerics\BigIntegerCalculator.SquMul.cs (12)
123
Span<nuint> fold =
BigInteger
.RentedBuffer.Create(foldLength, out
BigInteger
.RentedBuffer foldBuffer);
126
Span<nuint> core =
BigInteger
.RentedBuffer.Create(coreLength, out
BigInteger
.RentedBuffer coreBuffer);
452
Span<nuint> leftFold =
BigInteger
.RentedBuffer.Create(foldLength, out
BigInteger
.RentedBuffer leftFoldBuffer);
454
Span<nuint> rightFold =
BigInteger
.RentedBuffer.Create(foldLength, out
BigInteger
.RentedBuffer rightFoldBuffer);
463
Span<nuint> core =
BigInteger
.RentedBuffer.Create(coreLength, out
BigInteger
.RentedBuffer coreBuffer);
504
Span<nuint> carry =
BigInteger
.RentedBuffer.Create(carryLength, out
BigInteger
.RentedBuffer carryBuffer);
System\Numerics\Complex.cs (10)
791
public static explicit operator Complex(
BigInteger
value)
1749
else if (typeof(TOther) == typeof(
BigInteger
))
1756
BigInteger
actualResult = checked((
BigInteger
)value.m_real);
1928
else if (typeof(TOther) == typeof(
BigInteger
))
1930
BigInteger
actualResult = (
BigInteger
)value.m_real;
2070
else if (typeof(TOther) == typeof(
BigInteger
))
2072
BigInteger
actualResult = (
BigInteger
)value.m_real;
System.Security.Cryptography (33)
src\libraries\Common\src\System\Security\Cryptography\Asn1\DssParms.xml.cs (3)
14
internal System.Numerics.
BigInteger
P;
15
internal System.Numerics.
BigInteger
Q;
16
internal System.Numerics.
BigInteger
G;
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (4)
28
BigInteger
x;
80
BigInteger
y =
BigInteger
.ModPow(parms.G, x, parms.P);
94
BigInteger
y;
System\Security\Cryptography\KeyBlobHelpers.cs (1)
40
internal static byte[] ExportKeyParameter(this
BigInteger
value, int length)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (2)
15
internal System.Numerics.
BigInteger
Version;
139
internal System.Numerics.
BigInteger
Version;
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (4)
111
BigInteger
crlNumber,
128
BigInteger
crlNumber,
310
BigInteger
crlNumber,
329
BigInteger
crlNumber,
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (6)
43
public static CertificateRevocationListBuilder Load(byte[] currentCrl, out
BigInteger
currentCrlNumber)
49
out
BigInteger
crlNumber,
85
out
BigInteger
currentCrlNumber,
89
BigInteger
crlNumber = 0;
231
public static CertificateRevocationListBuilder LoadPem(string currentCrl, out
BigInteger
currentCrlNumber)
266
public static CertificateRevocationListBuilder LoadPem(ReadOnlySpan<char> currentCrl, out
BigInteger
currentCrlNumber)
System\Security\Cryptography\X509Certificates\FindPal.cs (8)
95
BigInteger
hexValue = new BigInteger(hexBytes, isUnsigned: true, isBigEndian: true);
96
BigInteger
decimalValue = LaxParseDecimalBigInteger(decimalOrHexString);
243
private static
BigInteger
LaxParseDecimalBigInteger(string decimalString)
245
BigInteger
ten = new BigInteger(10);
246
BigInteger
accum =
BigInteger
.Zero;
252
accum =
BigInteger
.Multiply(accum, ten);
253
accum =
BigInteger
.Add(accum, c - '0');
System\Security\Cryptography\X509Certificates\IFindPal.cs (2)
17
void FindBySerialNumber(
BigInteger
hexValue,
BigInteger
decimalValue);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (3)
99
public void FindBySerialNumber(
BigInteger
hexValue,
BigInteger
decimalValue)
106
BigInteger
serialNumber = new BigInteger(serialBytes, isUnsigned: true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\CoseHelpers.cs (1)
183
=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm,
BigInteger
.MinusOne - new BigInteger(alg)));
System.Security.Cryptography.Pkcs (1)
System\Security\Cryptography\Pkcs\CmsSignature.cs (1)
244
BigInteger
val = new BigInteger(
System.Security.Cryptography.Xml (3)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (3)
161
BigInteger
h;
162
if (!
BigInteger
.TryParse(serialNumber, NumberStyles.AllowHexSpecifier, NumberFormatInfo.CurrentInfo, out h))
167
if (h <
BigInteger
.Zero)