80 instantiations of BigInteger
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateFactoryTests.cs (2)
331new object[] { (Action<HttpContext, BigInteger[]>)Store, new[] { "-42" },new[]{ new BigInteger(-42) } }, 382new object[] { (Action<HttpContext, BigInteger>)Store, "-42", new BigInteger(-42) },
RequestDelegateGenerator\RequestDelegateCreationTests.Arrays.cs (1)
138new object[] { "BigInteger[]", new[] { "-42" },new[]{ new BigInteger(-42) } },
RequestDelegateGenerator\RequestDelegateCreationTests.TryParse.cs (1)
49new object[] { "BigInteger", "-42", new BigInteger(-42) },
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),
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)
32=> new BigInteger(bytes, isUnsigned: true, isBigEndian: true);
System.Runtime.Numerics (62)
System\Number.BigInteger.cs (4)
213result = new BigInteger((int)leading); 270result = new BigInteger(-1, bits); 278result = new BigInteger(1, bits); 393result = new BigInteger(resultBuffer, number.IsNegative);
System\Numerics\BigInteger.cs (58)
47private static readonly BigInteger s_bnMinInt = new BigInteger(-1, new uint[] { kuMaskHighBit }); 48private static readonly BigInteger s_bnOneInt = new BigInteger(1); 49private static readonly BigInteger s_bnZeroInt = new BigInteger(0); 50private static readonly BigInteger s_bnMinusOneInt = new BigInteger(-1); 787return new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 819remainder = new BigInteger(rest, dividend._sign < 0); 820var result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 892: new BigInteger(right._bits, negative: false); 900: new BigInteger(left._bits, negative: false); 948result = new BigInteger(bits, negative: false); 1022result = new BigInteger(bits, value._sign < 0 && !exponent.IsEven); 1064result = new BigInteger(bits, value._sign < 0 && (exponent & 1) != 0); 1075result = new BigInteger(bits, value._sign < 0 && (exponent & 1) != 0); 1664result = new BigInteger(bits, leftSign < 0); 1676result = new BigInteger(bits, leftSign < 0); 1688result = new BigInteger(bits, leftSign < 0); 1700result = new BigInteger(bits, leftSign < 0); 1742result = new BigInteger(bits, leftSign >= 0); 1754result = new BigInteger(bits, leftSign < 0); 1764result = new BigInteger(bits, leftSign >= 0); 1776result = new BigInteger(bits, leftSign < 0); 2105return new BigInteger(value); 2110return new BigInteger(value); 2118return new BigInteger((float)value); 2135return new BigInteger(value); 2144return new BigInteger(value); 2152return new BigInteger(value); 2157return new BigInteger(value); 2162return new BigInteger(value); 2167return new BigInteger(value); 2229return new BigInteger(sign, bits); 2239return new BigInteger(value); 2243return new BigInteger((int)value); 2250return new BigInteger(value); 2256return new BigInteger(value); 2262return new BigInteger(value); 2268return new BigInteger(value); 2312return new BigInteger(sign, bits); 2323return new BigInteger(value); 2327return new BigInteger((uint)value); 2379var result = new BigInteger(z); 2435var result = new BigInteger(z); 2486var result = new BigInteger(z); 2543var result = new BigInteger(zd, negx); 2635result = new BigInteger(zd, negx); 2654return new BigInteger(-value._sign, value._bits); 2717result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 2729result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 2739result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 2752result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 2765result = new BigInteger(bits, (leftSign < 0) ^ (rightSign < 0)); 2809return new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 2832var result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 2882var result = new BigInteger(bits, dividend._sign < 0); 3363var result = new BigInteger(zd, negx); 3497var result = new BigInteger(zd, negx); 3538value = new BigInteger(source, isUnsigned, isBigEndian: true); 3545value = new BigInteger(source, isUnsigned, isBigEndian: false);
System.Security.Cryptography (4)
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\ManagedCertificateFinder.cs (1)
106BigInteger serialNumber = new BigInteger(serialBytes, isUnsigned: true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\KnownCoseAlgorithms.cs (1)
38=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new BigInteger(alg)));
System.Security.Cryptography.Pkcs (2)
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
229BigInteger val = new BigInteger( 237val = new BigInteger(
System.Security.Cryptography.Xml (1)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (1)
177h = new BigInteger(bytes);
548 references to BigInteger
Microsoft.AspNetCore.Http.Extensions (4)
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.Http.Extensions.Tests (2)
RequestDelegateFactoryTests.cs (2)
331new object[] { (Action<HttpContext, BigInteger[]>)Store, new[] { "-42" },new[]{ new BigInteger(-42) } }, 382new object[] { (Action<HttpContext, BigInteger>)Store, "-42", new BigInteger(-42) },
Microsoft.AspNetCore.Mvc.Abstractions (4)
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\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)
106System.Numerics.BigInteger number = 0; 152System.Numerics.BigInteger number; 153if (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)
728Assembly.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)
netstandard (1)
netstandard.cs (1)
1331[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BigInteger))]
PresentationBuildTasks (3)
MS\Internal\MarkupCompiler\VersionHelper.cs (3)
115System.Numerics.BigInteger number = 0; 164System.Numerics.BigInteger number; 165if (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); 1616dataType == typeof(BigInteger) || 1964Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement"); 1972private bool BoundaryCheck(BigInteger value) => 1980private BigInteger _current; 1986private BigInteger _step = 1; 1992set { _current = (BigInteger)value; } 1995internal override Type DataType => typeof(BigInteger); 2045BigInteger v = (BigInteger)value; 2052private 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 (17)
System\Formats\Asn1\AsnDecoder.Integer.cs (4)
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);
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)
119BigInteger subIdentifier = ParseSubIdentifier(ref remaining); 150private static BigInteger ParseSubIdentifier(ref ReadOnlySpan<char> oidValue) 163BigInteger value = BigInteger.Zero; 191private static int EncodeSubIdentifier(Span<byte> dest, ref BigInteger subIdentifier) 201BigInteger unencoded = subIdentifier; 206BigInteger cur = unencoded & 0x7F; 218while (unencoded != BigInteger.Zero);
System.Formats.Cbor (7)
System\Formats\Cbor\CborHelpers.netcoreapp.cs (2)
31public static BigInteger CreateBigIntegerFromUnsignedBigEndianBytes(byte[] bytes) 34public 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)
92public void WriteBigInteger(BigInteger value) 95BigInteger unsignedValue = isUnsigned ? value : -1 - value; 131WriteBigInteger((BigInteger)mantissa);
System.Net.Security (2)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (2)
69internal BigInteger ReadInteger(Asn1Tag? expectedTag = default) 71BigInteger ret = AsnDecoder.ReadInteger(_span, _ruleSet, out int consumed, expectedTag);
System.Numerics (1)
System.Numerics.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Numerics.BigInteger))]
System.Runtime.Numerics (370)
System\Number.BigInteger.cs (13)
60internal static unsafe ParsingStatus TryParseBigInteger(ReadOnlySpan<char> value, NumberStyles style, NumberFormatInfo info, out BigInteger result) 80internal static unsafe ParsingStatus TryParseBigIntegerNumber(ReadOnlySpan<char> value, NumberStyles style, NumberFormatInfo info, out BigInteger result) 124internal static BigInteger ParseBigInteger(ReadOnlySpan<char> value, NumberStyles style, NumberFormatInfo info) 131ParsingStatus status = TryParseBigInteger(value, style, info, out BigInteger result); 140internal static ParsingStatus TryParseBigIntegerHexOrBinaryNumberStyle<TParser, TChar>(ReadOnlySpan<TChar> value, NumberStyles style, out BigInteger result) 239if (totalUIntCount > BigInteger.MaxLength) 308private static ParsingStatus NumberToBigInteger(ref NumberBuffer number, out BigInteger result) 551private static string? FormatBigIntegerToHex(bool targetSpan, BigInteger value, char format, int digits, NumberFormatInfo info, Span<char> destination, out int charsWritten, out bool spanSuccess) 634private static string? FormatBigIntegerToBinary(bool targetSpan, BigInteger value, int digits, Span<char> destination, out int charsWritten, out bool spanSuccess) 733internal static string FormatBigInteger(BigInteger value, string? format, NumberFormatInfo info) 738internal static bool TryFormatBigInteger(BigInteger value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<char> destination, out int charsWritten) 745bool targetSpan, BigInteger value, 791Debug.Assert((long)BigInteger.MaxLength * (MaxPartialDigits + 1) / MaxPartialDigits + 1 < (long)int.MaxValue); // won't overflow
System\Numerics\BigInteger.cs (347)
20IComparable<BigInteger>, 21IEquatable<BigInteger>, 22IBinaryInteger<BigInteger>, 23ISignedNumber<BigInteger> 47private static readonly BigInteger s_bnMinInt = new BigInteger(-1, new uint[] { kuMaskHighBit }); 48private static readonly BigInteger s_bnOneInt = new BigInteger(1); 49private static readonly BigInteger s_bnZeroInt = new BigInteger(0); 50private static readonly BigInteger s_bnMinusOneInt = new BigInteger(-1); 630public static BigInteger Zero { get { return s_bnZeroInt; } } 632public static BigInteger One { get { return s_bnOneInt; } } 634public static BigInteger MinusOne { get { return s_bnMinusOneInt; } } 665public static BigInteger Parse(string value) 670public static BigInteger Parse(string value, NumberStyles style) 675public static BigInteger Parse(string value, IFormatProvider? provider) 680public static BigInteger Parse(string value, NumberStyles style, IFormatProvider? provider) 686public static bool TryParse([NotNullWhen(true)] string? value, out BigInteger result) 691public static bool TryParse([NotNullWhen(true)] string? value, NumberStyles style, IFormatProvider? provider, out BigInteger result) 696public static BigInteger Parse(ReadOnlySpan<char> value, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null) 701public static bool TryParse(ReadOnlySpan<char> value, out BigInteger result) 706public static bool TryParse(ReadOnlySpan<char> value, NumberStyles style, IFormatProvider? provider, out BigInteger result) 711public static int Compare(BigInteger left, BigInteger right) 716public static BigInteger Abs(BigInteger value) 721public static BigInteger Add(BigInteger left, BigInteger right) 726public static BigInteger Subtract(BigInteger left, BigInteger right) 731public static BigInteger Multiply(BigInteger left, BigInteger right) 736public static BigInteger Divide(BigInteger dividend, BigInteger divisor) 741public static BigInteger Remainder(BigInteger dividend, BigInteger divisor) 746public static BigInteger DivRem(BigInteger dividend, BigInteger divisor, out BigInteger remainder) 756BigInteger quotient; 820var result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 832public static BigInteger Negate(BigInteger value) 837public static double Log(BigInteger value) 842public static double Log(BigInteger value, double baseValue) 869public static double Log10(BigInteger value) 874public static BigInteger GreatestCommonDivisor(BigInteger left, BigInteger right) 915private static BigInteger GreatestCommonDivisor(ReadOnlySpan<uint> leftBits, ReadOnlySpan<uint> rightBits) 920BigInteger result; 957public static BigInteger Max(BigInteger left, BigInteger right) 964public static BigInteger Min(BigInteger left, BigInteger right) 971public static BigInteger ModPow(BigInteger value, BigInteger exponent, BigInteger modulus) 983BigInteger result; 1031public static BigInteger Pow(BigInteger value, int exponent) 1046BigInteger result; 1101return obj is BigInteger other && Equals(other); 1140public bool Equals(BigInteger other) 1178public int CompareTo(BigInteger other) 1208if (obj is not BigInteger bigInt) 1644private static BigInteger Add(ReadOnlySpan<uint> leftBits, int leftSign, ReadOnlySpan<uint> rightBits, int rightSign) 1651BigInteger result; 1709public static BigInteger operator -(BigInteger left, BigInteger right) 1722private static BigInteger Subtract(ReadOnlySpan<uint> leftBits, int leftSign, ReadOnlySpan<uint> rightBits, int rightSign) 1729BigInteger result; 1789public static explicit operator byte(BigInteger value) 1797public static explicit operator char(BigInteger value) 1802public static explicit operator decimal(BigInteger value) 1823public static explicit operator double(BigInteger value) 1863public static explicit operator Half(BigInteger value) 1868public static explicit operator short(BigInteger value) 1873public static explicit operator int(BigInteger value) 1897public static explicit operator long(BigInteger value) 1933public static explicit operator Int128(BigInteger value) 1980public static explicit operator nint(BigInteger value) 1993public static explicit operator sbyte(BigInteger value) 1998public static explicit operator float(BigInteger value) 2004public static explicit operator ushort(BigInteger value) 2010public static explicit operator uint(BigInteger value) 2028public static explicit operator ulong(BigInteger value) 2053public static explicit operator UInt128(BigInteger value) 2087public static explicit operator nuint(BigInteger value) 2103public static explicit operator BigInteger(decimal value) 2108public static explicit operator BigInteger(double value) 2116public static explicit operator BigInteger(Half value) 2124public static explicit operator BigInteger(Complex value) 2130return (BigInteger)value.Real; 2133public static explicit operator BigInteger(float value) 2142public static implicit operator BigInteger(byte value) 2150public static implicit operator BigInteger(char value) 2155public static implicit operator BigInteger(short value) 2160public static implicit operator BigInteger(int value) 2165public static implicit operator BigInteger(long value) 2173public static implicit operator BigInteger(Int128 value) 2235public static implicit operator BigInteger(nint value) 2248public static implicit operator BigInteger(sbyte value) 2254public static implicit operator BigInteger(ushort value) 2260public static implicit operator BigInteger(uint value) 2266public static implicit operator BigInteger(ulong value) 2275public static implicit operator BigInteger(UInt128 value) 2319public static implicit operator BigInteger(nuint value) 2331public static BigInteger operator &(BigInteger left, BigInteger right) 2379var result = new BigInteger(z); 2387public static BigInteger operator |(BigInteger left, BigInteger right) 2435var result = new BigInteger(z); 2443public static BigInteger operator ^(BigInteger left, BigInteger right) 2486var result = new BigInteger(z); 2494public static BigInteger operator <<(BigInteger value, int shift) 2543var result = new BigInteger(zd, negx); 2553public static BigInteger operator >>(BigInteger value, int shift) 2566BigInteger result; 2646public static BigInteger operator ~(BigInteger value) 2651public static BigInteger operator -(BigInteger value) 2657public static BigInteger operator +(BigInteger value) 2663public static BigInteger operator ++(BigInteger value) 2668public static BigInteger operator --(BigInteger value) 2673public static BigInteger operator +(BigInteger left, BigInteger right) 2686public static BigInteger operator *(BigInteger left, BigInteger right) 2697private static BigInteger Multiply(ReadOnlySpan<uint> left, int leftSign, ReadOnlySpan<uint> right, int rightSign) 2704BigInteger result; 2774public static BigInteger operator /(BigInteger dividend, BigInteger divisor) 2832var result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0)); 2841public static BigInteger operator %(BigInteger dividend, BigInteger divisor) 2882var result = new BigInteger(bits, dividend._sign < 0); 2890public static bool operator <(BigInteger left, BigInteger right) 2895public static bool operator <=(BigInteger left, BigInteger right) 2900public static bool operator >(BigInteger left, BigInteger right) 2904public static bool operator >=(BigInteger left, BigInteger right) 2909public static bool operator ==(BigInteger left, BigInteger right) 2914public static bool operator !=(BigInteger left, BigInteger right) 2919public static bool operator <(BigInteger left, long right) 2924public static bool operator <=(BigInteger left, long right) 2929public static bool operator >(BigInteger left, long right) 2934public static bool operator >=(BigInteger left, long right) 2939public static bool operator ==(BigInteger left, long right) 2944public static bool operator !=(BigInteger left, long right) 2949public static bool operator <(long left, BigInteger right) 2954public static bool operator <=(long left, BigInteger right) 2959public static bool operator >(long left, BigInteger right) 2964public static bool operator >=(long left, BigInteger right) 2969public static bool operator ==(long left, BigInteger right) 2974public static bool operator !=(long left, BigInteger right) 2980public static bool operator <(BigInteger left, ulong right) 2986public static bool operator <=(BigInteger left, ulong right) 2992public static bool operator >(BigInteger left, ulong right) 2998public static bool operator >=(BigInteger left, ulong right) 3004public static bool operator ==(BigInteger left, ulong right) 3010public static bool operator !=(BigInteger left, ulong right) 3016public static bool operator <(ulong left, BigInteger right) 3022public static bool operator <=(ulong left, BigInteger right) 3028public static bool operator >(ulong left, BigInteger right) 3034public static bool operator >=(ulong left, BigInteger right) 3040public static bool operator ==(ulong left, BigInteger right) 3046public static bool operator !=(ulong left, BigInteger right) 3154static BigInteger IAdditiveIdentity<BigInteger, BigInteger>.AdditiveIdentity => Zero; 3161public static (BigInteger Quotient, BigInteger Remainder) DivRem(BigInteger left, BigInteger right) 3163BigInteger quotient = DivRem(left, right, out BigInteger remainder); 3168public static BigInteger LeadingZeroCount(BigInteger value) 3184public static BigInteger PopCount(BigInteger value) 3239public static BigInteger RotateLeft(BigInteger value, int rotateAmount) 3363var result = new BigInteger(zd, negx); 3374public static BigInteger RotateRight(BigInteger value, int rotateAmount) 3497var result = new BigInteger(zd, negx); 3508public static BigInteger TrailingZeroCount(BigInteger value) 3536static bool IBinaryInteger<BigInteger>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out BigInteger value) 3543static bool IBinaryInteger<BigInteger>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out BigInteger value) 3550int IBinaryInteger<BigInteger>.GetShortestBitLength() 3599int IBinaryInteger<BigInteger>.GetByteCount() => GetGenericMathByteCount(); 3602bool IBinaryInteger<BigInteger>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten) 3704bool IBinaryInteger<BigInteger>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten) 3849static BigInteger IBinaryNumber<BigInteger>.AllBitsSet => MinusOne; 3852public static bool IsPow2(BigInteger value) => value.IsPowerOfTwo; 3855public static BigInteger Log2(BigInteger value) 3877static BigInteger IMultiplicativeIdentity<BigInteger, BigInteger>.MultiplicativeIdentity => One; 3884public static BigInteger Clamp(BigInteger value, BigInteger min, BigInteger max) 3915public static BigInteger CopySign(BigInteger value, BigInteger sign) 3938static BigInteger INumber<BigInteger>.MaxNumber(BigInteger x, BigInteger y) => Max(x, y); 3941static BigInteger INumber<BigInteger>.MinNumber(BigInteger x, BigInteger y) => Min(x, y); 3944static int INumber<BigInteger>.Sign(BigInteger value) 3961static int INumberBase<BigInteger>.Radix => 2; 3965public static BigInteger CreateChecked<TOther>(TOther value) 3968BigInteger result; 3970if (typeof(TOther) == typeof(BigInteger)) 3972result = (BigInteger)(object)value; 3984public static BigInteger CreateSaturating<TOther>(TOther value) 3987BigInteger result; 3989if (typeof(TOther) == typeof(BigInteger)) 3991result = (BigInteger)(object)value; 4003public static BigInteger CreateTruncating<TOther>(TOther value) 4006BigInteger result; 4008if (typeof(TOther) == typeof(BigInteger)) 4010result = (BigInteger)(object)value; 4021static bool INumberBase<BigInteger>.IsCanonical(BigInteger value) => true; 4024static bool INumberBase<BigInteger>.IsComplexNumber(BigInteger value) => false; 4027public static bool IsEvenInteger(BigInteger value) 4039static bool INumberBase<BigInteger>.IsFinite(BigInteger value) => true; 4042static bool INumberBase<BigInteger>.IsImaginaryNumber(BigInteger value) => false; 4045static bool INumberBase<BigInteger>.IsInfinity(BigInteger value) => false; 4048static bool INumberBase<BigInteger>.IsInteger(BigInteger value) => true; 4051static bool INumberBase<BigInteger>.IsNaN(BigInteger value) => false; 4054public static bool IsNegative(BigInteger value) 4061static bool INumberBase<BigInteger>.IsNegativeInfinity(BigInteger value) => false; 4064static bool INumberBase<BigInteger>.IsNormal(BigInteger value) => (value != 0); 4067public static bool IsOddInteger(BigInteger value) 4079public static bool IsPositive(BigInteger value) 4086static bool INumberBase<BigInteger>.IsPositiveInfinity(BigInteger value) => false; 4089static bool INumberBase<BigInteger>.IsRealNumber(BigInteger value) => true; 4092static bool INumberBase<BigInteger>.IsSubnormal(BigInteger value) => false; 4095static bool INumberBase<BigInteger>.IsZero(BigInteger value) 4102public static BigInteger MaxMagnitude(BigInteger x, BigInteger y) 4107BigInteger ax = Abs(x); 4108BigInteger ay = Abs(y); 4124static BigInteger INumberBase<BigInteger>.MaxMagnitudeNumber(BigInteger x, BigInteger y) => MaxMagnitude(x, y); 4127public static BigInteger MinMagnitude(BigInteger x, BigInteger y) 4132BigInteger ax = Abs(x); 4133BigInteger ay = Abs(y); 4149static BigInteger INumberBase<BigInteger>.MinMagnitudeNumber(BigInteger x, BigInteger y) => MinMagnitude(x, y); 4152static BigInteger INumberBase<BigInteger>.MultiplyAddEstimate(BigInteger left, BigInteger right, BigInteger addend) => (left * right) + addend; 4156static bool INumberBase<BigInteger>.TryConvertFromChecked<TOther>(TOther value, out BigInteger result) => TryConvertFromChecked(value, out result); 4159private static bool TryConvertFromChecked<TOther>(TOther value, out BigInteger result) 4177result = (BigInteger)actualValue; 4183result = checked((BigInteger)actualValue); 4189result = checked((BigInteger)actualValue); 4231result = checked((BigInteger)actualValue); 4273static bool INumberBase<BigInteger>.TryConvertFromSaturating<TOther>(TOther value, out BigInteger result) => TryConvertFromSaturating(value, out result); 4276private static bool TryConvertFromSaturating<TOther>(TOther value, out BigInteger result) 4294result = (BigInteger)actualValue; 4300result = double.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4306result = Half.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4348result = float.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4390static bool INumberBase<BigInteger>.TryConvertFromTruncating<TOther>(TOther value, out BigInteger result) => TryConvertFromTruncating(value, out result); 4393private static bool TryConvertFromTruncating<TOther>(TOther value, out BigInteger result) 4411result = (BigInteger)actualValue; 4417result = double.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4423result = Half.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4465result = float.IsNaN(actualValue) ? Zero : (BigInteger)actualValue; 4507static bool INumberBase<BigInteger>.TryConvertToChecked<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 4626static bool INumberBase<BigInteger>.TryConvertToSaturating<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 4819static bool INumberBase<BigInteger>.TryConvertToTruncating<TOther>(BigInteger value, [MaybeNullWhen(false)] out TOther result) 5218public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out BigInteger result) => TryParse(s, NumberStyles.Integer, provider, out result); 5225public static BigInteger operator >>>(BigInteger value, int shiftAmount) 5240BigInteger result;
System\Numerics\Complex.cs (10)
791public static explicit operator Complex(BigInteger value) 1719else if (typeof(TOther) == typeof(BigInteger)) 1726BigInteger actualResult = checked((BigInteger)value.m_real); 1892else if (typeof(TOther) == typeof(BigInteger)) 1894BigInteger actualResult = (BigInteger)value.m_real; 2028else if (typeof(TOther) == typeof(BigInteger)) 2030BigInteger actualResult = (BigInteger)value.m_real;
System.Security.Cryptography (44)
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\libraries\Common\src\System\Security\Cryptography\Asn1\RSAPrivateKeyAsn.xml.cs (8)
15internal System.Numerics.BigInteger Modulus; 16internal System.Numerics.BigInteger PublicExponent; 17internal System.Numerics.BigInteger PrivateExponent; 18internal System.Numerics.BigInteger Prime1; 19internal System.Numerics.BigInteger Prime2; 20internal System.Numerics.BigInteger Exponent1; 21internal System.Numerics.BigInteger Exponent2; 22internal System.Numerics.BigInteger Coefficient;
src\libraries\Common\src\System\Security\Cryptography\Asn1\RSAPublicKeyAsn.xml.cs (2)
14internal System.Numerics.BigInteger Modulus; 15internal System.Numerics.BigInteger PublicExponent;
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (2)
69internal BigInteger ReadInteger(Asn1Tag? expectedTag = default) 71BigInteger ret = AsnDecoder.ReadInteger(_span, _ruleSet, out int consumed, expectedTag);
src\libraries\Common\src\System\Security\Cryptography\DSAKeyFormatHelper.cs (4)
28BigInteger x; 80BigInteger y = BigInteger.ModPow(parms.G, x, parms.P); 94BigInteger y;
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
51internal static byte[] ExportKeyParameter(this BigInteger value, int length)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (1)
15internal System.Numerics.BigInteger Version;
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Build.cs (4)
110BigInteger crlNumber, 127BigInteger crlNumber, 295BigInteger crlNumber, 314BigInteger 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\IFindPal.cs (2)
17void FindBySerialNumber(BigInteger hexValue, BigInteger decimalValue);
System\Security\Cryptography\X509Certificates\ManagedCertificateFinder.cs (3)
99public void FindBySerialNumber(BigInteger hexValue, BigInteger decimalValue) 106BigInteger serialNumber = new BigInteger(serialBytes, isUnsigned: true);
System.Security.Cryptography.Cose (1)
System\Security\Cryptography\Cose\KnownCoseAlgorithms.cs (1)
38=> throw new CryptographicException(SR.Format(SR.Sign1UnknownCoseAlgorithm, BigInteger.MinusOne - new BigInteger(alg)));
System.Security.Cryptography.Pkcs (3)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (2)
69internal BigInteger ReadInteger(Asn1Tag? expectedTag = default) 71BigInteger ret = AsnDecoder.ReadInteger(_span, _ruleSet, out int consumed, expectedTag);
System\Security\Cryptography\Pkcs\CmsSignature.cs (1)
229BigInteger val = new BigInteger(
System.Security.Cryptography.Xml (3)
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (3)
167BigInteger h; 168if (!BigInteger.TryParse(serialNumber, NumberStyles.AllowHexSpecifier, NumberFormatInfo.CurrentInfo, out h)) 173if (h < BigInteger.Zero)