102 instantiations of BigInteger
Microsoft.CodeAnalysis (2)
RealParser.cs (2)
62private static readonly BigInteger s_bigTwo = new BigInteger(2); 63private static readonly BigInteger s_bigTen = new BigInteger(10);
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
100P10 = new BigInteger(3.1415),
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
src\sdk\src\StaticWebAssetsSdk\Tasks\Utils\FileHasher.cs (1)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray()));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (2)
ScopedCss\ComputeCssScope.cs (1)
67var dividend = BigInteger.Abs(new BigInteger([.. hash.AsSpan()[..9]]));
Utils\FileHasher.cs (1)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray()));
NuGet.Packaging (3)
Signing\DerEncoding\DerEncoder.cs (1)
1005BigInteger divisor = new BigInteger(128);
Signing\DerEncoding\DerSequenceReader.cs (2)
228BigInteger bigInt = new BigInteger(integerBytes); 301BigInteger bigInt = new BigInteger(0);
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnDecoder.Integer.cs (1)
108BigInteger value = new BigInteger(contents, isBigEndian: true);
System\Formats\Asn1\AsnDecoder.Oid.cs (1)
225largeValue = 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 (82)
System\Number.BigInteger.cs (6)
265result = new BigInteger((int)signedLeading, null); 275result = new BigInteger((int)signBits | 1, [(leading ^ signBits) - signBits]); 281result = new BigInteger(-1, [0, 1]); 331result = new BigInteger(-1, bits); 340result = new BigInteger(1, bits); 458result = new BigInteger(resultBuffer, number.IsNegative);
System\Numerics\BigInteger.cs (76)
59private static readonly BigInteger s_int32MinValue = new(-1, [UInt32HighBit]); 60private static readonly BigInteger s_one = new(1); 61private static readonly BigInteger s_zero = new(0); 62private static readonly BigInteger s_minusOne = new(-1); 884return new BigInteger((int)NumericsHelpers.Abs(value._sign), value._bits); 945return new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 965remainder = new(rest, dividend._sign < 0); 966BigInteger result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 1062: new BigInteger(+1, right._bits); 1070: new BigInteger(+1, left._bits); 1109result = new BigInteger(bits, negative: false); 1169result = new BigInteger(bits, value._sign < 0 && !exponent.IsEven); 1217result = new BigInteger(bits, value._sign < 0 && (exponent & 1) != 0); 1226result = new BigInteger(bits, value._sign < 0 && (exponent & 1) != 0); 1906result = new BigInteger(bits, leftSign < 0); 1917result = new BigInteger(bits, leftSign < 0); 1928result = new BigInteger(bits, leftSign < 0); 1939result = new BigInteger(bits, leftSign < 0); 1975result = new BigInteger(bits, leftSign >= 0); 1986result = new BigInteger(bits, leftSign < 0); 1995result = new BigInteger(bits, leftSign >= 0); 2006result = new BigInteger(bits, leftSign < 0); 2485public static explicit operator BigInteger(decimal value) => new BigInteger(value); 2487public static explicit operator BigInteger(double value) => new BigInteger(value); 2492public static explicit operator BigInteger(Half value) => new BigInteger((float)value); 2497public static explicit operator BigInteger(BFloat16 value) => new BigInteger((float)value); 2512public static explicit operator BigInteger(float value) => new BigInteger(value); 2518public static implicit operator BigInteger(byte value) => new BigInteger(value); 2523public static implicit operator BigInteger(char value) => new BigInteger(value); 2525public static implicit operator BigInteger(short value) => new BigInteger(value); 2527public static implicit operator BigInteger(int value) => new BigInteger(value); 2529public static implicit operator BigInteger(long value) => new BigInteger(value); 2596return new BigInteger(sign, bits); 2602public static implicit operator BigInteger(nint value) => new BigInteger(value); 2605public static implicit operator BigInteger(sbyte value) => new BigInteger(value); 2608public static implicit operator BigInteger(ushort value) => new BigInteger(value); 2611public static implicit operator BigInteger(uint value) => new BigInteger(value); 2614public static implicit operator BigInteger(ulong value) => new BigInteger(value); 2665return new BigInteger(sign, bits); 2672public static implicit operator BigInteger(nuint value) => value <= int.MaxValue ? new BigInteger((int)value, null) : new BigInteger(+1, [value]); 2751BigInteger result = new(z); 2813return new BigInteger(value._sign, z); 2836return new BigInteger(value >= 0 ? (int)r : -(int)r, null); 2849return new BigInteger(value > 0 ? 1 : -1, rgu); 2881return new BigInteger(value._sign >> smallShift, null); 2892return new BigInteger(value._sign >> 31, null); 2913BigInteger result = new(zd, neg); 2938result = new BigInteger(bits, negative: true); 2947result = new BigInteger(bits, negative: false); 2954public static BigInteger operator -(BigInteger value) => new BigInteger(-value._sign, value._bits); 2973result = new BigInteger(bits, negative: false); 2981result = new BigInteger(bits, negative: true); 3002result = new BigInteger(bits, negative: false); 3011result = new BigInteger(bits, negative: true); 3052result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 3063result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 3072result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 3083result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 3117BigInteger result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 3136BigInteger result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 3179BigInteger result = new(bits, dividend._sign < 0); 3463? new BigInteger((int)rs) 3464: new BigInteger(rs); 3484? new BigInteger((int)rs) 3485: new BigInteger(rs); 3678BigInteger result = new(zd, negative); 3740BigInteger result = new(zd, negative); 3776value = new BigInteger(source, isUnsigned, isBigEndian: true); 3783value = new BigInteger(source, isUnsigned, isBigEndian: false); 5428return new BigInteger((nint)value._sign >>> smallShift); 5469return new BigInteger(nint.MinValue >>> smallShift); 5474return new BigInteger(smallShift == 0 ? -1 : +1, rgu); 5517result = new BigInteger(zd, true); 5521result = new BigInteger(zd, false); 5529return new BigInteger(value._sign >> 31, null);
System.Security.Cryptography (4)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (1)
43x = new BigInteger(xSpan, isUnsigned: true, isBigEndian: true);
System\Security\Cryptography\X509Certificates\FindPal.cs (2)
95BigInteger hexValue = new BigInteger(hexBytes, isUnsigned: true, isBigEndian: true); 245BigInteger ten = new BigInteger(10);
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (1)
101BigInteger actualAsBigInteger = new BigInteger(actual, 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)
244BigInteger val = new BigInteger( 252val = new BigInteger(
System.Security.Cryptography.Xml (1)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (1)
171h = new BigInteger(bytes);
694 references to BigInteger
Microsoft.AspNetCore.Http.Extensions (4)
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
672else if (type == typeof(BigInteger)) 674method = typeof(BigInteger).GetMethod( 675nameof(BigInteger.TryParse), 677new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(BigInteger).MakeByRefType() });
Microsoft.AspNetCore.Mvc.Abstractions (4)
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
672else if (type == typeof(BigInteger)) 674method = typeof(BigInteger).GetMethod( 675nameof(BigInteger.TryParse), 677new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(BigInteger).MakeByRefType() });
Microsoft.AspNetCore.OpenApi (4)
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (4)
672else if (type == typeof(BigInteger)) 674method = typeof(BigInteger).GetMethod( 675nameof(BigInteger.TryParse), 677new[] { typeof(string), typeof(NumberStyles), typeof(IFormatProvider), typeof(BigInteger).MakeByRefType() });
Microsoft.CodeAnalysis (25)
RealParser.cs (22)
60private static readonly BigInteger s_bigZero = BigInteger.Zero; 61private static readonly BigInteger s_bigOne = BigInteger.One; 62private static readonly BigInteger s_bigTwo = new BigInteger(2); 63private static readonly BigInteger s_bigTen = new BigInteger(10); 415BigInteger integerValue = AccumulateDecimalDigitsIntoBigInteger(data, integerFirstIndex, integerLastIndex); 465BigInteger fractionalNumerator = AccumulateDecimalDigitsIntoBigInteger(data, fractionalFirstIndex, fractionalLastIndex); 468BigInteger fractionalDenominator = s_bigOne; 531BigInteger fractionalRemainder; 532BigInteger bigFractionalMantissa = BigInteger.DivRem(fractionalNumerator, fractionalDenominator, out fractionalRemainder); 621private static BigInteger AccumulateDecimalDigitsIntoBigInteger(DecimalFloatingPointString data, uint integer_first_index, uint integer_last_index) 625return BigInteger.Parse(valueString); 661private static uint CountSignificantBits(BigInteger data, out byte[] dataBytes) 682private static uint CountSignificantBits(BigInteger data) 750private static void ShiftLeft(ref BigInteger number, uint shift) 752var powerOfTwo = BigInteger.Pow(s_bigTwo, (int)shift); 761private static void MultiplyByPowerOfTen(ref BigInteger number, uint power) 763var powerOfTen = BigInteger.Pow(s_bigTen, (int)power);
VersionHelper.cs (3)
118System.Numerics.BigInteger number = 0; 164System.Numerics.BigInteger number; 165if (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)
27public BigInteger P10 { get; set; }
Microsoft.Gen.Logging.Unit.Tests (3)
CompilationHelper.cs (1)
37refs.Add(MetadataReference.CreateFromFile(typeof(BigInteger).Assembly.Location));
EmitterTests.cs (1)
47Assembly.GetAssembly(typeof(BigInteger))!,
ParserTests.cs (1)
727Assembly.GetAssembly(typeof(BigInteger))!,
Microsoft.ML.Parquet (2)
ParquetLoader.cs (2)
517return CreateGetterDelegateCore<BigInteger, DataViewRowId>(col, _parquetConversions.Conv); 725public void Conv(in BigInteger src, ref DataViewRowId dst)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (4)
src\sdk\src\StaticWebAssetsSdk\Tasks\Utils\FileHasher.cs (4)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray())); 48dividend = BigInteger.DivRem(dividend, 36, out var remainder);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (8)
ScopedCss\ComputeCssScope.cs (4)
67var dividend = BigInteger.Abs(new BigInteger([.. hash.AsSpan()[..9]])); 73dividend = BigInteger.DivRem(dividend, 36, out var remainder);
Utils\FileHasher.cs (4)
42var dividend = BigInteger.Abs(new BigInteger(hash.AsSpan()[..9].ToArray())); 48dividend = BigInteger.DivRem(dividend, 36, out var remainder);
netstandard (1)
netstandard.cs (1)
1331[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BigInteger))]
NuGet.Packaging (12)
Signing\DerEncoding\DerEncoder.cs (10)
485BigInteger rid = ParseOidRid(oidValue, ref startPos); 966private static BigInteger ParseOidRid(string oidValue, ref int startIndex) 983BigInteger value = BigInteger.Zero; 1003private static void EncodeRid(List<byte> encodedData, ref BigInteger rid) 1005BigInteger divisor = new BigInteger(128); 1006BigInteger unencoded = rid; 1018BigInteger remainder; 1019unencoded = BigInteger.DivRem(unencoded, divisor, out remainder); 1028while (unencoded != BigInteger.Zero);
Signing\DerEncoding\DerSequenceReader.cs (2)
228BigInteger bigInt = new BigInteger(integerBytes); 301BigInteger bigInt = new BigInteger(0);
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (3)
114System.Numerics.BigInteger number = 0; 163System.Numerics.BigInteger number; 164if (System.Numerics.BigInteger.TryParse(s, NumberStyles.None, CultureInfo.InvariantCulture, out number))
System.Data.Common (51)
System\Data\Common\BigIntegerStorage.cs (23)
13private BigInteger[] _values = default!; // Late-initialized 16base(column, typeof(BigInteger), BigInteger.Zero, StorageType.BigInteger) 27BigInteger valueNo1 = _values[recordNo1]; 28BigInteger valueNo2 = _values[recordNo2]; 52BigInteger valueNo1 = _values[recordNo]; 58return valueNo1.CompareTo((BigInteger)value); 62internal static BigInteger ConvertToBigInteger(object value, IFormatProvider formatProvider) 64if (value.GetType() == typeof(BigInteger)) { return (BigInteger)value; } 65else if (value.GetType() == typeof(string)) { return BigInteger.Parse((string)value, formatProvider); } 74else { throw ExceptionBuilder.ConvertFailed(value.GetType(), typeof(System.Numerics.BigInteger)); } 77internal static object ConvertFromBigInteger(BigInteger value, Type type, IFormatProvider formatProvider) 91else if (type == typeof(System.Numerics.BigInteger)) { return value; } 92else { throw ExceptionBuilder.ConvertFailed(typeof(System.Numerics.BigInteger), type); } 119BigInteger value = _values[record]; 132_values[record] = BigInteger.Zero; 152return BigInteger.Parse(s, System.Globalization.CultureInfo.InvariantCulture); 159return ((BigInteger)value).ToString("D", System.Globalization.CultureInfo.InvariantCulture); 164return new BigInteger[recordCount]; 169BigInteger[] typedStore = (BigInteger[])store; 176_values = (BigInteger[])store;
System\Data\Common\DataStorage.cs (2)
92typeof(System.Numerics.BigInteger), 579dataType = typeof(System.Numerics.BigInteger);
System\Data\Common\SQLConvert.cs (3)
350if (type == typeof(System.Numerics.BigInteger)) 355else if (value is System.Numerics.BigInteger) 357return BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)value, type, formatProvider);
System\Data\DataColumn.cs (17)
262if ((BigInteger)AutoIncrementSeed != BigIntegerStorage.ConvertToBigInteger(value, FormatProvider)) 270(_autoInc ??= ((DataType == typeof(BigInteger)) ? 512if (_defaultValue is BigInteger) 514_defaultValue = BigIntegerStorage.ConvertFromBigInteger((BigInteger)_defaultValue, value, FormatProvider); 516else if (typeof(BigInteger) == value) 584AutoInc.Current = (BigInteger)(long)inc.Current; 588AutoInc.Current = checked((long)(BigInteger)inc.Current); 1608dataType == typeof(BigInteger) || 1956Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement"); 1964private bool BoundaryCheck(BigInteger value) => 1972private BigInteger _current; 1978private BigInteger _step = 1; 1984set { _current = (BigInteger)value; } 1987internal override Type DataType => typeof(BigInteger); 2037BigInteger v = (BigInteger)value; 2044private bool BoundaryCheck(BigInteger value) =>
System\Data\TypeLimiter.cs (1)
170typeof(BigInteger),
System\Data\xmlsaver.cs (5)
87else if (entry.Value is System.Numerics.BigInteger) 89v = (string)BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)entry.Value, typeof(string), CultureInfo.InvariantCulture); 199if (bIsSqlType || (col.DataType == typeof(System.Numerics.BigInteger))) 265if (type == typeof(System.Numerics.BigInteger)) 1348if ((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)
99public static BigInteger ReadInteger( 108BigInteger value = new BigInteger(contents, isBigEndian: true); 584public BigInteger ReadInteger(Asn1Tag? expectedTag = null) 586BigInteger ret = AsnDecoder.ReadInteger(_data.Span, RuleSet, out int consumed, expectedTag); 814public BigInteger ReadInteger(Asn1Tag? expectedTag = null) 816BigInteger ret = AsnDecoder.ReadInteger(_data, RuleSet, out int consumed, expectedTag);
System\Formats\Asn1\AsnDecoder.Oid.cs (3)
83out BigInteger? largeValue) 252ReadSubIdentifier(contents, out int bytesRead, out long? smallValue, out BigInteger? largeValue); 289BigInteger firstIdentifier = largeValue.Value;
System\Formats\Asn1\AsnWriter.Integer.cs (2)
60public void WriteInteger(BigInteger value, Asn1Tag? tag = null) 279private void WriteIntegerCore(Asn1Tag tag, BigInteger value)
System\Formats\Asn1\AsnWriter.Oid.cs (8)
116BigInteger subIdentifier = ParseSubIdentifier(ref remaining); 147private static BigInteger ParseSubIdentifier(ref ReadOnlySpan<char> oidValue) 160BigInteger value = BigInteger.Zero; 188private static int EncodeSubIdentifier(Span<byte> dest, ref BigInteger subIdentifier) 198BigInteger unencoded = subIdentifier; 203BigInteger cur = unencoded & 0x7F; 215while (unencoded != BigInteger.Zero);
System.Formats.Cbor (7)
System\Formats\Cbor\CborHelpers.netcoreapp.cs (2)
15public static BigInteger CreateBigIntegerFromUnsignedBigEndianBytes(byte[] bytes) 18public static byte[] CreateUnsignedBigEndianBytesFromBigInteger(BigInteger value)
System\Formats\Cbor\Reader\CborReader.Tag.cs (2)
153public BigInteger ReadBigInteger() 178BigInteger unsignedValue = CborHelpers.CreateBigIntegerFromUnsignedBigEndianBytes(unsignedBigEndianEncoding);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (3)
88public void WriteBigInteger(BigInteger value) 91BigInteger unsignedValue = isUnsigned ? value : -1 - value; 127WriteBigInteger((BigInteger)mantissa);
System.Numerics (1)
System.Numerics.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BigInteger))]
System.Runtime.Numerics (507)
System\Number.BigInteger.cs (32)
58internal static ParsingStatus TryParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out BigInteger result, out int elementsConsumed) 72internal static ParsingStatus TryParseBigIntegerPartial<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out BigInteger result, out int elementsConsumed) 83private static ParsingStatus TryParseBigIntegerCore<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out BigInteger result, out int elementsConsumed) 99internal static unsafe ParsingStatus TryParseBigIntegerNumber<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out BigInteger result, out int elementsConsumed) 146internal static BigInteger ParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info) 154ParsingStatus status = TryParseBigIntegerCore(value, style, info, out BigInteger result, out _); 163internal static ParsingStatus TryParseBigIntegerHexOrBinaryNumberStyle<TParser, TChar>(ReadOnlySpan<TChar> value, NumberStyles style, out BigInteger result, out int elementsConsumed) 291if (totalUIntCount > BigInteger.MaxLength) 320if (bits.Length + 1 > BigInteger.MaxLength) 372private static ParsingStatus NumberToBigInteger(ref NumberBuffer number, out BigInteger result) 419base1E9 = BigInteger.RentedBuffer.Create(base1E9Length, out BigInteger.RentedBuffer base1E9Rental); 444Span<nuint> resultBuffer = BigInteger.RentedBuffer.Create(resultLength, out BigInteger.RentedBuffer resultRental); 476Span<nuint> leading = BigInteger.RentedBuffer.Create(leadingLength, out BigInteger.RentedBuffer leadingBuffer); 516scoped Span<nuint> buffer = BigInteger.RentedBuffer.Create(bufferLength, out BigInteger.RentedBuffer bufferRental); 615private static unsafe string? FormatBigIntegerToHex<TChar>(bool targetSpan, BigInteger value, char format, int digits, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess) 701private static unsafe string? FormatBigIntegerToBinary<TChar>(bool targetSpan, BigInteger value, int digits, Span<TChar> destination, out int charsWritten, out bool spanSuccess) 804internal static string FormatBigInteger(BigInteger value, string? format, NumberFormatInfo info) 809internal static bool TryFormatBigInteger<TChar>(BigInteger value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten) 816private 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) 877Debug.Assert(BigInteger.MaxLength * digitRatio + 1 < Array.MaxLength); // won't overflow 880Span<nuint> base1E9Buffer = BigInteger.RentedBuffer.Create(base1E9BufferLength, out BigInteger.RentedBuffer base1E9Rental); 1070Span<nuint> upper = BigInteger.RentedBuffer.Create(upperLength, out BigInteger.RentedBuffer upperBuffer); 1073Span<nuint> lower = BigInteger.RentedBuffer.Create(lowerLength, out BigInteger.RentedBuffer lowerBuffer); 1477Span<nuint> powersOfTen = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer powersOfTenBuffer);
System\Numerics\BigInteger.cs (392)
20IComparable<BigInteger>, 21IEquatable<BigInteger>, 22IBinaryInteger<BigInteger>, 23ISignedNumber<BigInteger>, 35/// Maximum number of limbs in a <see cref="BigInteger"/>. Restricts allocations to ~256MB, 59private static readonly BigInteger s_int32MinValue = new(-1, [UInt32HighBit]); 60private static readonly BigInteger s_one = new(1); 61private static readonly BigInteger s_zero = new(0); 62private 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"/>. 765public static BigInteger Zero => s_zero; 767public static BigInteger One => s_one; 769public static BigInteger MinusOne => s_minusOne; 798public static BigInteger Parse(string value) 803public static BigInteger Parse(string value, NumberStyles style) 808public static BigInteger Parse(string value, IFormatProvider? provider) 813public static BigInteger Parse(string value, NumberStyles style, IFormatProvider? provider) 819public static bool TryParse([NotNullWhen(true)] string? value, out BigInteger result) 824public static bool TryParse([NotNullWhen(true)] string? value, NumberStyles style, IFormatProvider? provider, out BigInteger result) 829public static BigInteger Parse(ReadOnlySpan<char> value, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) 834public static BigInteger Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) 839public static bool TryParse(ReadOnlySpan<char> value, out BigInteger result) 844public static bool TryParse(ReadOnlySpan<char> value, NumberStyles style, IFormatProvider? provider, out BigInteger result) 849public static bool TryParse(ReadOnlySpan<byte> utf8Text, out BigInteger result) 854public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out BigInteger result) 860public static bool TryParsePartial([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out BigInteger result, out int charsConsumed) 866public static bool TryParsePartial(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out BigInteger result, out int bytesConsumed) 872public static bool TryParsePartial(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out BigInteger result, out int charsConsumed) 877public static int Compare(BigInteger left, BigInteger right) 882public static BigInteger Abs(BigInteger value) 887public static BigInteger Add(BigInteger left, BigInteger right) 892public static BigInteger Subtract(BigInteger left, BigInteger right) 897public static BigInteger Multiply(BigInteger left, BigInteger right) 902public static BigInteger Divide(BigInteger dividend, BigInteger divisor) 907public static BigInteger Remainder(BigInteger dividend, BigInteger divisor) 912public static BigInteger DivRem(BigInteger dividend, BigInteger divisor, out BigInteger remainder) 919BigInteger quotient; 966BigInteger result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 975public static BigInteger Negate(BigInteger value) 980public static double Log(BigInteger value) 985public static double Log(BigInteger value, double baseValue) 1042public static double Log10(BigInteger value) 1047public static BigInteger GreatestCommonDivisor(BigInteger left, BigInteger right) 1080private static BigInteger GreatestCommonDivisor(ReadOnlySpan<nuint> leftBits, ReadOnlySpan<nuint> rightBits) 1084BigInteger result; 1116public static BigInteger Max(BigInteger left, BigInteger right) 1121public static BigInteger Min(BigInteger left, BigInteger right) 1126public static BigInteger ModPow(BigInteger value, BigInteger exponent, BigInteger modulus) 1134BigInteger result; 1177public static BigInteger Pow(BigInteger value, int exponent) 1194BigInteger result; 1248return obj is BigInteger other && Equals(other); 1311public bool Equals(BigInteger other) 1383public int CompareTo(BigInteger other) 1414obj is BigInteger bigInt ? CompareTo(bigInt) : 1889private static BigInteger Add(ReadOnlySpan<nuint> leftBits, int leftSign, ReadOnlySpan<nuint> rightBits, int rightSign) 1896BigInteger result; 1946public static BigInteger operator -(BigInteger left, BigInteger right) 1958private static BigInteger Subtract(ReadOnlySpan<nuint> leftBits, int leftSign, ReadOnlySpan<nuint> rightBits, int rightSign) 1965BigInteger result; 2017public static explicit operator byte(BigInteger value) => checked((byte)((int)value)); 2022public static explicit operator char(BigInteger value) => checked((char)((int)value)); 2024public static explicit operator decimal(BigInteger value) 2034public static explicit operator double(BigInteger value) 2065private static double ConvertToDouble(BigInteger value, int precision) 2201public static explicit operator Half(BigInteger value) 2220public static explicit operator BFloat16(BigInteger value) 2242public static explicit operator short(BigInteger value) => checked((short)((int)value)); 2244public static explicit operator int(BigInteger value) 2271public static explicit operator long(BigInteger value) 2311public static explicit operator Int128(BigInteger value) 2360public static explicit operator nint(BigInteger value) => Environment.Is64BitProcess ? (nint)(long)value : (int)value; 2363public static explicit operator sbyte(BigInteger value) => checked((sbyte)((int)value)); 2365public static explicit operator float(BigInteger value) 2393public static explicit operator ushort(BigInteger value) => checked((ushort)((int)value)); 2396public static explicit operator uint(BigInteger value) 2411public static explicit operator ulong(BigInteger value) 2439public static explicit operator UInt128(BigInteger value) 2479public static explicit operator nuint(BigInteger value) => Environment.Is64BitProcess ? (nuint)(ulong)value : (uint)value; 2485public static explicit operator BigInteger(decimal value) => new BigInteger(value); 2487public static explicit operator BigInteger(double value) => new BigInteger(value); 2492public static explicit operator BigInteger(Half value) => new BigInteger((float)value); 2497public static explicit operator BigInteger(BFloat16 value) => new BigInteger((float)value); 2502public static explicit operator BigInteger(Complex value) 2509return (BigInteger)value.Real; 2512public static explicit operator BigInteger(float value) => new BigInteger(value); 2518public static implicit operator BigInteger(byte value) => new BigInteger(value); 2523public static implicit operator BigInteger(char value) => new BigInteger(value); 2525public static implicit operator BigInteger(short value) => new BigInteger(value); 2527public static implicit operator BigInteger(int value) => new BigInteger(value); 2529public static implicit operator BigInteger(long value) => new BigInteger(value); 2534public static implicit operator BigInteger(Int128 value) 2602public static implicit operator BigInteger(nint value) => new BigInteger(value); 2605public static implicit operator BigInteger(sbyte value) => new BigInteger(value); 2608public static implicit operator BigInteger(ushort value) => new BigInteger(value); 2611public static implicit operator BigInteger(uint value) => new BigInteger(value); 2614public static implicit operator BigInteger(ulong value) => new BigInteger(value); 2620public static implicit operator BigInteger(UInt128 value) 2672public static implicit operator BigInteger(nuint value) => value <= int.MaxValue ? new BigInteger((int)value, null) : new BigInteger(+1, [value]); 2674public static BigInteger operator &(BigInteger left, BigInteger right) => 2676left._bits is null && right._bits is null ? (BigInteger)(left._sign & right._sign) : 2679public static BigInteger operator |(BigInteger left, BigInteger right) 2692? (BigInteger)(left._sign | right._sign) 2696public static BigInteger operator ^(BigInteger left, BigInteger right) => 2698? (BigInteger)(left._sign ^ right._sign) 2705private static BigInteger BitwiseAnd(ref readonly BigInteger left, ref readonly BigInteger right) 2724private static BigInteger BitwiseOr(ref readonly BigInteger left, ref readonly BigInteger right) 2734private static BigInteger BitwiseXor(ref readonly BigInteger left, ref readonly BigInteger right) 2741private static BigInteger BitwiseOp<TOp>(ref readonly BigInteger left, ref readonly BigInteger right, int zLen) 2751BigInteger result = new(z); 2758public static BigInteger operator <<(BigInteger value, int shift) 2816private static BigInteger LeftShift(int value, int digitShift, int smallShift) 2852public static BigInteger operator >>(BigInteger value, int shift) 2913BigInteger result = new(zd, neg); 2920public static BigInteger operator ~(BigInteger value) 2929BigInteger result; 2954public static BigInteger operator -(BigInteger value) => new BigInteger(-value._sign, value._bits); 2956public static BigInteger operator +(BigInteger value) => value; 2958public static BigInteger operator ++(BigInteger value) 2965BigInteger result; 2988public static BigInteger operator --(BigInteger value) 2995BigInteger result; 3018public static BigInteger operator +(BigInteger left, BigInteger right) 3030public static BigInteger operator *(BigInteger left, BigInteger right) => 3032? (BigInteger)((long)left._sign * right._sign) 3035private static BigInteger Multiply(ReadOnlySpan<nuint> left, int leftSign, ReadOnlySpan<nuint> right, int rightSign) 3042BigInteger result; 3090public static BigInteger operator /(BigInteger dividend, BigInteger divisor) 3117BigInteger result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 3136BigInteger result = new(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 3144public static BigInteger operator %(BigInteger dividend, BigInteger divisor) 3179BigInteger result = new(bits, dividend._sign < 0); 3186public static bool operator <(BigInteger left, BigInteger right) => left.CompareTo(right) < 0; 3188public static bool operator <=(BigInteger left, BigInteger right) => left.CompareTo(right) <= 0; 3190public static bool operator >(BigInteger left, BigInteger right) => left.CompareTo(right) > 0; 3192public static bool operator >=(BigInteger left, BigInteger right) => left.CompareTo(right) >= 0; 3194public static bool operator ==(BigInteger left, BigInteger right) => left.Equals(right); 3196public static bool operator !=(BigInteger left, BigInteger right) => !left.Equals(right); 3198public static bool operator <(BigInteger left, long right) => left.CompareTo(right) < 0; 3200public static bool operator <=(BigInteger left, long right) => left.CompareTo(right) <= 0; 3202public static bool operator >(BigInteger left, long right) => left.CompareTo(right) > 0; 3204public static bool operator >=(BigInteger left, long right) => left.CompareTo(right) >= 0; 3206public static bool operator ==(BigInteger left, long right) => left.Equals(right); 3208public static bool operator !=(BigInteger left, long right) => !left.Equals(right); 3210public static bool operator <(long left, BigInteger right) => right.CompareTo(left) > 0; 3212public static bool operator <=(long left, BigInteger right) => right.CompareTo(left) >= 0; 3214public static bool operator >(long left, BigInteger right) => right.CompareTo(left) < 0; 3216public static bool operator >=(long left, BigInteger right) => right.CompareTo(left) <= 0; 3218public static bool operator ==(long left, BigInteger right) => right.Equals(left); 3220public static bool operator !=(long left, BigInteger right) => !right.Equals(left); 3223public static bool operator <(BigInteger left, ulong right) => left.CompareTo(right) < 0; 3226public static bool operator <=(BigInteger left, ulong right) => left.CompareTo(right) <= 0; 3229public static bool operator >(BigInteger left, ulong right) => left.CompareTo(right) > 0; 3232public static bool operator >=(BigInteger left, ulong right) => left.CompareTo(right) >= 0; 3235public static bool operator ==(BigInteger left, ulong right) => left.Equals(right); 3238public static bool operator !=(BigInteger left, ulong right) => !left.Equals(right); 3241public static bool operator <(ulong left, BigInteger right) => right.CompareTo(left) > 0; 3244public static bool operator <=(ulong left, BigInteger right) => right.CompareTo(left) >= 0; 3247public static bool operator >(ulong left, BigInteger right) => right.CompareTo(left) < 0; 3250public static bool operator >=(ulong left, BigInteger right) => right.CompareTo(left) <= 0; 3253public static bool operator ==(ulong left, BigInteger right) => right.Equals(left); 3256public static bool operator !=(ulong left, BigInteger right) => !right.Equals(left); 3329static BigInteger IAdditiveIdentity<BigInteger, BigInteger>.AdditiveIdentity => Zero; 3336static BigInteger IBinaryInteger<BigInteger>.Log10(BigInteger value) 3358BigInteger log2Value = Log2(value); 3359BigInteger approx = ((log2Value + 1) * 1292913986L) >> 32; 3360BigInteger power = Pow(10, (int)approx); 3366public static (BigInteger Quotient, BigInteger Remainder) DivRem(BigInteger left, BigInteger right) 3368BigInteger quotient = DivRem(left, right, out BigInteger remainder); 3373public static BigInteger LeadingZeroCount(BigInteger value) 3395public static BigInteger PopCount(BigInteger value) 3450public static BigInteger RotateLeft(BigInteger value, int rotateAmount) 3471public static BigInteger RotateRight(BigInteger value, int rotateAmount) 3491private static BigInteger Rotate(ReadOnlySpan<nuint> bits, bool negative, long rotateLeftAmount) 3678BigInteger result = new(zd, negative); 3703private static BigInteger RotateNuint(ReadOnlySpan<nuint> bits, bool negative, long rotateLeftAmount) 3740BigInteger result = new(zd, negative); 3748public static BigInteger TrailingZeroCount(BigInteger value) 3774static bool IBinaryInteger<BigInteger>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out BigInteger value) 3781static bool IBinaryInteger<BigInteger>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out BigInteger value) 3788int IBinaryInteger<BigInteger>.GetShortestBitLength() 3825int IBinaryInteger<BigInteger>.GetByteCount() => GetGenericMathByteCount(); 3828bool IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 3906bool IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 4021static BigInteger IBinaryNumber<BigInteger>.AllBitsSet => MinusOne; 4024public static bool IsPow2(BigInteger value) => value.IsPowerOfTwo; 4027public static BigInteger Log2(BigInteger value) 4035? (BigInteger)((BigIntegerCalculator.BitsPerLimb - 1) ^ BitOperations.LeadingZeroCount((nuint)value._sign | 1)) 4036: (BigInteger)(((long)value._bits.Length * BigIntegerCalculator.BitsPerLimb - 1) ^ BitOperations.LeadingZeroCount(value._bits[^1])); 4044static BigInteger IMultiplicativeIdentity<BigInteger, BigInteger>.MultiplicativeIdentity => One; 4051public static BigInteger Clamp(BigInteger value, BigInteger min, BigInteger max) 4077public static BigInteger CopySign(BigInteger value, BigInteger sign) 4097static BigInteger INumber<BigInteger>.MaxNumber(BigInteger x, BigInteger y) => Max(x, y); 4100static BigInteger INumber<BigInteger>.MinNumber(BigInteger x, BigInteger y) => Min(x, y); 4103static int INumber<BigInteger>.Sign(BigInteger value) 4115static int INumberBase<BigInteger>.Radix => 2; 4119public static BigInteger CreateChecked<TOther>(TOther value) 4122BigInteger result; 4124if (typeof(TOther) == typeof(BigInteger)) 4126result = (BigInteger)(object)value; 4138public static BigInteger CreateSaturating<TOther>(TOther value) 4141BigInteger result; 4143if (typeof(TOther) == typeof(BigInteger)) 4145result = (BigInteger)(object)value; 4157public static BigInteger CreateTruncating<TOther>(TOther value) 4160BigInteger result; 4162if (typeof(TOther) == typeof(BigInteger)) 4164result = (BigInteger)(object)value; 4175static bool INumberBase<BigInteger>.IsCanonical(BigInteger value) => true; 4178static bool INumberBase<BigInteger>.IsComplexNumber(BigInteger value) => false; 4181public static bool IsEvenInteger(BigInteger value) 4189static bool INumberBase<BigInteger>.IsFinite(BigInteger value) => true; 4192static bool INumberBase<BigInteger>.IsImaginaryNumber(BigInteger value) => false; 4195static bool INumberBase<BigInteger>.IsInfinity(BigInteger value) => false; 4198static bool INumberBase<BigInteger>.IsInteger(BigInteger value) => true; 4201static bool INumberBase<BigInteger>.IsNaN(BigInteger value) => false; 4204public static bool IsNegative(BigInteger value) 4210static bool INumberBase<BigInteger>.IsNegativeInfinity(BigInteger value) => false; 4213static bool INumberBase<BigInteger>.IsNormal(BigInteger value) => (value != 0); 4216public static bool IsOddInteger(BigInteger value) 4224public static bool IsPositive(BigInteger value) 4230static bool INumberBase<BigInteger>.IsPositiveInfinity(BigInteger value) => false; 4233static bool INumberBase<BigInteger>.IsRealNumber(BigInteger value) => true; 4236static bool INumberBase<BigInteger>.IsSubnormal(BigInteger value) => false; 4239static bool INumberBase<BigInteger>.IsZero(BigInteger value) 4245public static BigInteger MaxMagnitude(BigInteger x, BigInteger y) 4252static BigInteger INumberBase<BigInteger>.MaxMagnitudeNumber(BigInteger x, BigInteger y) => MaxMagnitude(x, y); 4255public static BigInteger MinMagnitude(BigInteger x, BigInteger y) 4262static BigInteger INumberBase<BigInteger>.MinMagnitudeNumber(BigInteger x, BigInteger y) => MinMagnitude(x, y); 4265static BigInteger INumberBase<BigInteger>.MultiplyAddEstimate(BigInteger left, BigInteger right, BigInteger addend) => (left * right) + addend; 4269static bool INumberBase<BigInteger>.TryConvertFromChecked<TOther>(TOther value, out BigInteger result) => TryConvertFromChecked(value, out result); 4272private static bool TryConvertFromChecked<TOther>(TOther value, out BigInteger result) 4290result = (BigInteger)actualValue; 4296result = checked((BigInteger)actualValue); 4302result = checked((BigInteger)actualValue); 4308result = checked((BigInteger)actualValue); 4350result = checked((BigInteger)actualValue); 4392static bool INumberBase<BigInteger>.TryConvertFromSaturating<TOther>(TOther value, out BigInteger result) => TryConvertFromSaturating(value, out result); 4395private static bool TryConvertFromSaturating<TOther>(TOther value, out BigInteger result) 4413result = (BigInteger)actualValue; 4419result = double.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4425result = Half.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4431result = BFloat16.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4473result = float.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4515static bool INumberBase<BigInteger>.TryConvertFromTruncating<TOther>(TOther value, out BigInteger result) => TryConvertFromTruncating(value, out result); 4518private static bool TryConvertFromTruncating<TOther>(TOther value, out BigInteger result) 4536result = (BigInteger)actualValue; 4542result = double.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4548result = Half.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4554result = BFloat16.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4596result = float.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4638static bool INumberBase<BigInteger>.TryConvertToChecked<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 4763static bool INumberBase<BigInteger>.TryConvertToSaturating<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 4962static bool INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 5393public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out BigInteger result) => TryParse(s, NumberStyles.Integer, provider, out result); 5400public static BigInteger operator >>>(BigInteger value, int shiftAmount) 5509BigInteger result; 5536static BigInteger ISignedNumber<BigInteger>.NegativeOne => MinusOne; 5543public static BigInteger Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider); 5546public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out BigInteger result) => TryParse(s, NumberStyles.Integer, provider, out result); 5553public static BigInteger Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Integer, provider); 5556public 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)
99Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer); 131Span<nuint> quotient = BigInteger.RentedBuffer.Create(quotientLength, out BigInteger.RentedBuffer quotientBuffer); 163Span<nuint> leftCopy = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer leftCopyBuffer); 167Span<nuint> quotientAllocated = BigInteger.RentedBuffer.Create(quotientLength, out BigInteger.RentedBuffer quotientActualBuffer); 336Span<nuint> b = BigInteger.RentedBuffer.Create(n, out BigInteger.RentedBuffer bBuffer); 349Span<nuint> a = BigInteger.RentedBuffer.Create(aLength, out BigInteger.RentedBuffer aBuffer); 385Span<nuint> r = BigInteger.RentedBuffer.Create(n + 1, out BigInteger.RentedBuffer rBuffer); 387Span<nuint> z = BigInteger.RentedBuffer.Create(2 * n, out BigInteger.RentedBuffer zBuffer); 394Span<nuint> q = BigInteger.RentedBuffer.Create(n, out BigInteger.RentedBuffer qBuffer); 501Span<nuint> r1 = BigInteger.RentedBuffer.Create(left.Length, out BigInteger.RentedBuffer r1Buffer); 541Span<nuint> r1 = BigInteger.RentedBuffer.Create(right.Length + 1, out BigInteger.RentedBuffer r1Buffer); 566Span<nuint> d = BigInteger.RentedBuffer.Create(right.Length, out BigInteger.RentedBuffer dBuffer);
System\Numerics\BigIntegerCalculator.GcdInv.cs (2)
97Span<nuint> rightCopy = BigInteger.RentedBuffer.Create(right.Length, out BigInteger.RentedBuffer rightCopyBuffer);
System\Numerics\BigIntegerCalculator.PowMod.cs (30)
25Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 27Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer valueCopyBuffer); 267Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer valueCopyBuffer); 283Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 307Span<nuint> valueCopy = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer valueCopyBuffer); 323Span<nuint> temp = BigInteger.RentedBuffer.Create(bits.Length, out BigInteger.RentedBuffer tempBuffer); 392Span<nuint> r = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer rBuffer); 395Span<nuint> mu = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer muBuffer); 398Span<nuint> q1 = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer q1Buffer); 400Span<nuint> q2 = BigInteger.RentedBuffer.Create(size, out BigInteger.RentedBuffer q2Buffer); 496Span<nuint> shifted = BigInteger.RentedBuffer.Create(shiftLen, out BigInteger.RentedBuffer shiftedBuffer); 511Span<nuint> rModN = BigInteger.RentedBuffer.Create(k, out BigInteger.RentedBuffer rModNBuffer); 514Span<nuint> oneShifted = BigInteger.RentedBuffer.Create(oneShiftLen, out BigInteger.RentedBuffer oneShiftedBuffer); 563Span<nuint> prod = BigInteger.RentedBuffer.Create(bufLen, out BigInteger.RentedBuffer prodBuffer); 566Span<nuint> base2 = BigInteger.RentedBuffer.Create(k, out BigInteger.RentedBuffer base2Buffer);
System\Numerics\BigIntegerCalculator.ShiftRot.cs (4)
84Span<nuint> tmp = BigInteger.RentedBuffer.Create(tmpLength, out BigInteger.RentedBuffer tmpBuffer); 121Span<nuint> tmpNuint = BigInteger.RentedBuffer.Create(nuintCount, out BigInteger.RentedBuffer tmpBuffer);
System\Numerics\BigIntegerCalculator.SquMul.cs (12)
123Span<nuint> fold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer foldBuffer); 126Span<nuint> core = BigInteger.RentedBuffer.Create(coreLength, out BigInteger.RentedBuffer coreBuffer); 452Span<nuint> leftFold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer leftFoldBuffer); 454Span<nuint> rightFold = BigInteger.RentedBuffer.Create(foldLength, out BigInteger.RentedBuffer rightFoldBuffer); 463Span<nuint> core = BigInteger.RentedBuffer.Create(coreLength, out BigInteger.RentedBuffer coreBuffer); 504Span<nuint> carry = BigInteger.RentedBuffer.Create(carryLength, out BigInteger.RentedBuffer carryBuffer);
System\Numerics\Complex.cs (1)
368public static explicit operator Complex(BigInteger value)
System\Numerics\Complex.Generic.cs (9)
1797if (typeof(TOther) == typeof(BigInteger)) 1804BigInteger actualResult = checked((BigInteger)double.CreateChecked(value.m_real)); 1843if (typeof(TOther) == typeof(BigInteger)) 1845BigInteger actualResult = (BigInteger)double.CreateSaturating(value.m_real); 1874if (typeof(TOther) == typeof(BigInteger)) 1876BigInteger actualResult = (BigInteger)double.CreateTruncating(value.m_real);
System.Security.Cryptography (33)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\DssParms.xml.cs (3)
14internal System.Numerics.BigInteger P; 15internal System.Numerics.BigInteger Q; 16internal System.Numerics.BigInteger G;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (4)
28BigInteger x; 80BigInteger y = BigInteger.ModPow(parms.G, x, parms.P); 94BigInteger y;
System\Security\Cryptography\KeyBlobHelpers.cs (1)
40internal static byte[] ExportKeyParameter(this BigInteger value, int length)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (2)
15internal System.Numerics.BigInteger Version; 139internal System.Numerics.BigInteger Version;
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (4)
111BigInteger crlNumber, 128BigInteger crlNumber, 310BigInteger crlNumber, 329BigInteger crlNumber,
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (6)
43public static CertificateRevocationListBuilder Load(byte[] currentCrl, out BigInteger currentCrlNumber) 49out BigInteger crlNumber, 85out BigInteger currentCrlNumber, 89BigInteger crlNumber = 0; 231public static CertificateRevocationListBuilder LoadPem(string currentCrl, out BigInteger currentCrlNumber) 266public static CertificateRevocationListBuilder LoadPem(ReadOnlySpan<char> currentCrl, out BigInteger currentCrlNumber)
System\Security\Cryptography\X509Certificates\FindPal.cs (8)
95BigInteger hexValue = new BigInteger(hexBytes, isUnsigned: true, isBigEndian: true); 96BigInteger decimalValue = LaxParseDecimalBigInteger(decimalOrHexString); 243private static BigInteger LaxParseDecimalBigInteger(string decimalString) 245BigInteger ten = new BigInteger(10); 246BigInteger accum = BigInteger.Zero; 252accum = BigInteger.Multiply(accum, ten); 253accum = BigInteger.Add(accum, c - '0');
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (3)
90public unsafe void FindBySerialNumber(BigInteger hexValue, BigInteger decimalValue) 101BigInteger actualAsBigInteger = new BigInteger(actual, isUnsigned: true);
System\Security\Cryptography\X509Certificates\IFindPal.cs (2)
17void FindBySerialNumber(BigInteger hexValue, BigInteger decimalValue);
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)
244BigInteger val = new BigInteger(
System.Security.Cryptography.Xml (3)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (3)
161BigInteger h; 162if (!BigInteger.TryParse(serialNumber, NumberStyles.AllowHexSpecifier, NumberFormatInfo.CurrentInfo, out h)) 167if (h < BigInteger.Zero)