93 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)
32
=> new
BigInteger
(bytes, isUnsigned: true, isBigEndian: true);
System.Runtime.Numerics (79)
System\Number.BigInteger.cs (6)
215
result = new
BigInteger
((int)leading);
225
result = new
BigInteger
((int)signBits | 1, [(leading ^ signBits) - signBits]);
231
result = new
BigInteger
(-1, [0, 1]);
278
result = new
BigInteger
(-1, bits);
286
result = new
BigInteger
(1, bits);
401
result = new
BigInteger
(resultBuffer, number.IsNegative);
System\Numerics\BigInteger.cs (73)
47
private static readonly BigInteger s_bnMinInt = new
BigInteger
(-1, new uint[] { kuMaskHighBit });
48
private static readonly BigInteger s_bnOneInt = new
BigInteger
(1);
49
private static readonly BigInteger s_bnZeroInt = new
BigInteger
(0);
50
private static readonly BigInteger s_bnMinusOneInt = new
BigInteger
(-1);
738
return new
BigInteger
(unchecked((int)NumericsHelpers.Abs(value._sign)), value._bits);
807
return new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
839
remainder = new
BigInteger
(rest, dividend._sign < 0);
840
var result = new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
912
: new
BigInteger
(right._bits, negative: false);
920
: new
BigInteger
(left._bits, negative: false);
968
result = new
BigInteger
(bits, negative: false);
1042
result = new
BigInteger
(bits, value._sign < 0 && !exponent.IsEven);
1084
result = new
BigInteger
(bits, value._sign < 0 && (exponent & 1) != 0);
1095
result = new
BigInteger
(bits, value._sign < 0 && (exponent & 1) != 0);
1716
result = new
BigInteger
(bits, leftSign < 0);
1728
result = new
BigInteger
(bits, leftSign < 0);
1740
result = new
BigInteger
(bits, leftSign < 0);
1752
result = new
BigInteger
(bits, leftSign < 0);
1794
result = new
BigInteger
(bits, leftSign >= 0);
1806
result = new
BigInteger
(bits, leftSign < 0);
1816
result = new
BigInteger
(bits, leftSign >= 0);
1828
result = new
BigInteger
(bits, leftSign < 0);
2165
return new
BigInteger
(value);
2170
return new
BigInteger
(value);
2178
return new
BigInteger
((float)value);
2186
return new
BigInteger
((float)value);
2203
return new
BigInteger
(value);
2212
return new
BigInteger
(value);
2220
return new
BigInteger
(value);
2225
return new
BigInteger
(value);
2230
return new
BigInteger
(value);
2235
return new
BigInteger
(value);
2297
return new
BigInteger
(sign, bits);
2307
return new
BigInteger
(value);
2311
return new
BigInteger
((int)value);
2318
return new
BigInteger
(value);
2324
return new
BigInteger
(value);
2330
return new
BigInteger
(value);
2336
return new
BigInteger
(value);
2380
return new
BigInteger
(sign, bits);
2391
return new
BigInteger
(value);
2395
return new
BigInteger
((uint)value);
2447
var result = new
BigInteger
(z);
2503
var result = new
BigInteger
(z);
2554
var result = new
BigInteger
(z);
2609
return new
BigInteger
(value._sign, z);
2629
return new
BigInteger
(value << smallShift, null);
2641
return new
BigInteger
(Math.Sign(value), rgu);
2667
return new
BigInteger
(value._sign >> smallShift, null);
2677
return new
BigInteger
(value._sign >> (kcbitUint - 1), null);
2700
BigInteger result = new
BigInteger
(zd, neg);
2716
return new
BigInteger
(-value._sign, value._bits);
2779
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2791
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2801
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2814
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2827
result = new
BigInteger
(bits, (leftSign < 0) ^ (rightSign < 0));
2871
return new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2894
var result = new
BigInteger
(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2944
var result = new
BigInteger
(bits, dividend._sign < 0);
3287
? new
BigInteger
((int)rs)
3288
: new
BigInteger
(rs);
3308
? new
BigInteger
((int)rs)
3309
: new
BigInteger
(rs);
3364
var result = new
BigInteger
(zd, negative);
3403
value = new
BigInteger
(source, isUnsigned, isBigEndian: true);
3410
value = new
BigInteger
(source, isUnsigned, isBigEndian: false);
5124
return new
BigInteger
(value._sign >>> smallShift, null);
5161
return new
BigInteger
(int.MinValue >>> smallShift);
5165
return new
BigInteger
(smallShift == 0 ? -1 : +1, rgu);
5211
result = new
BigInteger
(zd, true);
5215
result = new
BigInteger
(zd, false);
5224
return new
BigInteger
(value._sign >> (kcbitUint - 1), 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);
547 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 (17)
System\Formats\Asn1\AsnDecoder.Integer.cs (4)
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);
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)
31
public static
BigInteger
CreateBigIntegerFromUnsignedBigEndianBytes(byte[] bytes)
34
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)
92
public void WriteBigInteger(
BigInteger
value)
95
BigInteger
unsignedValue = isUnsigned ? value : -1 - value;
131
WriteBigInteger((
BigInteger
)mantissa);
System.Net.Security (2)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (2)
69
internal
BigInteger
ReadInteger(Asn1Tag? expectedTag = default)
71
BigInteger
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 (381)
System\Number.BigInteger.cs (14)
58
internal static ParsingStatus TryParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out
BigInteger
result)
79
internal static unsafe ParsingStatus TryParseBigIntegerNumber<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info, out
BigInteger
result)
125
internal static
BigInteger
ParseBigInteger<TChar>(ReadOnlySpan<TChar> value, NumberStyles style, NumberFormatInfo info)
133
ParsingStatus status = TryParseBigInteger(value, style, info, out
BigInteger
result);
142
internal static ParsingStatus TryParseBigIntegerHexOrBinaryNumberStyle<TParser, TChar>(ReadOnlySpan<TChar> value, NumberStyles style, out
BigInteger
result)
241
if (totalUIntCount >
BigInteger
.MaxLength)
268
if (bits.Length + 1 >
BigInteger
.MaxLength)
316
private static ParsingStatus NumberToBigInteger(ref NumberBuffer number, out
BigInteger
result)
559
private static string? FormatBigIntegerToHex<TChar>(bool targetSpan,
BigInteger
value, char format, int digits, NumberFormatInfo info, Span<TChar> destination, out int charsWritten, out bool spanSuccess)
644
private static string? FormatBigIntegerToBinary<TChar>(bool targetSpan,
BigInteger
value, int digits, Span<TChar> destination, out int charsWritten, out bool spanSuccess)
744
internal static string FormatBigInteger(
BigInteger
value, string? format, NumberFormatInfo info)
749
internal static bool TryFormatBigInteger<TChar>(
BigInteger
value, ReadOnlySpan<char> format, NumberFormatInfo info, Span<TChar> destination, out int charsWritten)
756
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)
816
Debug.Assert(
BigInteger
.MaxLength * digitRatio + 1 < Array.MaxLength); // won't overflow
System\Numerics\BigInteger.cs (357)
20
IComparable<
BigInteger
>,
21
IEquatable<
BigInteger
>,
22
IBinaryInteger<
BigInteger
>,
23
ISignedNumber<
BigInteger
>
47
private static readonly
BigInteger
s_bnMinInt = new BigInteger(-1, new uint[] { kuMaskHighBit });
48
private static readonly
BigInteger
s_bnOneInt = new BigInteger(1);
49
private static readonly
BigInteger
s_bnZeroInt = new BigInteger(0);
50
private static readonly
BigInteger
s_bnMinusOneInt = new BigInteger(-1);
634
public static
BigInteger
Zero { get { return s_bnZeroInt; } }
636
public static
BigInteger
One { get { return s_bnOneInt; } }
638
public static
BigInteger
MinusOne { get { return s_bnMinusOneInt; } }
669
public static
BigInteger
Parse(string value)
674
public static
BigInteger
Parse(string value, NumberStyles style)
679
public static
BigInteger
Parse(string value, IFormatProvider? provider)
684
public static
BigInteger
Parse(string value, NumberStyles style, IFormatProvider? provider)
690
public static bool TryParse([NotNullWhen(true)] string? value, out
BigInteger
result)
695
public static bool TryParse([NotNullWhen(true)] string? value, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
700
public static
BigInteger
Parse(ReadOnlySpan<char> value, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
705
public static
BigInteger
Parse(ReadOnlySpan<byte> utf8Text, NumberStyles style = NumberStyles.Integer, IFormatProvider? provider = null)
710
public static bool TryParse(ReadOnlySpan<char> value, out
BigInteger
result)
715
public static bool TryParse(ReadOnlySpan<char> value, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
720
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
BigInteger
result)
725
public static bool TryParse(ReadOnlySpan<byte> utf8Text, NumberStyles style, IFormatProvider? provider, out
BigInteger
result)
730
public static int Compare(
BigInteger
left,
BigInteger
right)
735
public static
BigInteger
Abs(
BigInteger
value)
741
public static
BigInteger
Add(
BigInteger
left,
BigInteger
right)
746
public static
BigInteger
Subtract(
BigInteger
left,
BigInteger
right)
751
public static
BigInteger
Multiply(
BigInteger
left,
BigInteger
right)
756
public static
BigInteger
Divide(
BigInteger
dividend,
BigInteger
divisor)
761
public static
BigInteger
Remainder(
BigInteger
dividend,
BigInteger
divisor)
766
public static
BigInteger
DivRem(
BigInteger
dividend,
BigInteger
divisor, out
BigInteger
remainder)
776
BigInteger
quotient;
840
var
result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
852
public static
BigInteger
Negate(
BigInteger
value)
857
public static double Log(
BigInteger
value)
862
public static double Log(
BigInteger
value, double baseValue)
889
public static double Log10(
BigInteger
value)
894
public static
BigInteger
GreatestCommonDivisor(
BigInteger
left,
BigInteger
right)
935
private static
BigInteger
GreatestCommonDivisor(ReadOnlySpan<uint> leftBits, ReadOnlySpan<uint> rightBits)
940
BigInteger
result;
977
public static
BigInteger
Max(
BigInteger
left,
BigInteger
right)
984
public static
BigInteger
Min(
BigInteger
left,
BigInteger
right)
991
public static
BigInteger
ModPow(
BigInteger
value,
BigInteger
exponent,
BigInteger
modulus)
1003
BigInteger
result;
1051
public static
BigInteger
Pow(
BigInteger
value, int exponent)
1066
BigInteger
result;
1121
return obj is
BigInteger
other && Equals(other);
1160
public bool Equals(
BigInteger
other)
1198
public int CompareTo(
BigInteger
other)
1228
if (obj is not
BigInteger
bigInt)
1696
private static
BigInteger
Add(ReadOnlySpan<uint> leftBits, int leftSign, ReadOnlySpan<uint> rightBits, int rightSign)
1703
BigInteger
result;
1761
public static
BigInteger
operator -(
BigInteger
left,
BigInteger
right)
1774
private static
BigInteger
Subtract(ReadOnlySpan<uint> leftBits, int leftSign, ReadOnlySpan<uint> rightBits, int rightSign)
1781
BigInteger
result;
1841
public static explicit operator byte(
BigInteger
value)
1849
public static explicit operator char(
BigInteger
value)
1854
public static explicit operator decimal(
BigInteger
value)
1875
public static explicit operator double(
BigInteger
value)
1915
public static explicit operator Half(
BigInteger
value)
1923
public static explicit operator BFloat16(
BigInteger
value)
1928
public static explicit operator short(
BigInteger
value)
1933
public static explicit operator int(
BigInteger
value)
1957
public static explicit operator long(
BigInteger
value)
1993
public static explicit operator Int128(
BigInteger
value)
2040
public static explicit operator nint(
BigInteger
value)
2053
public static explicit operator sbyte(
BigInteger
value)
2058
public static explicit operator float(
BigInteger
value)
2064
public static explicit operator ushort(
BigInteger
value)
2070
public static explicit operator uint(
BigInteger
value)
2088
public static explicit operator ulong(
BigInteger
value)
2113
public static explicit operator UInt128(
BigInteger
value)
2147
public static explicit operator nuint(
BigInteger
value)
2163
public static explicit operator
BigInteger
(decimal value)
2168
public static explicit operator
BigInteger
(double value)
2176
public static explicit operator
BigInteger
(Half value)
2184
public static explicit operator
BigInteger
(BFloat16 value)
2192
public static explicit operator
BigInteger
(Complex value)
2198
return (
BigInteger
)value.Real;
2201
public static explicit operator
BigInteger
(float value)
2210
public static implicit operator
BigInteger
(byte value)
2218
public static implicit operator
BigInteger
(char value)
2223
public static implicit operator
BigInteger
(short value)
2228
public static implicit operator
BigInteger
(int value)
2233
public static implicit operator
BigInteger
(long value)
2241
public static implicit operator
BigInteger
(Int128 value)
2303
public static implicit operator
BigInteger
(nint value)
2316
public static implicit operator
BigInteger
(sbyte value)
2322
public static implicit operator
BigInteger
(ushort value)
2328
public static implicit operator
BigInteger
(uint value)
2334
public static implicit operator
BigInteger
(ulong value)
2343
public static implicit operator
BigInteger
(UInt128 value)
2387
public static implicit operator
BigInteger
(nuint value)
2399
public static
BigInteger
operator &(
BigInteger
left,
BigInteger
right)
2447
var
result = new BigInteger(z);
2455
public static
BigInteger
operator |(
BigInteger
left,
BigInteger
right)
2503
var
result = new BigInteger(z);
2511
public static
BigInteger
operator ^(
BigInteger
left,
BigInteger
right)
2554
var
result = new BigInteger(z);
2562
public static
BigInteger
operator <<(
BigInteger
value, int shift)
2611
private static
BigInteger
LeftShift(int value, int digitShift, int smallShift)
2644
public static
BigInteger
operator >>(
BigInteger
value, int shift)
2700
BigInteger
result = new BigInteger(zd, neg);
2708
public static
BigInteger
operator ~(
BigInteger
value)
2713
public static
BigInteger
operator -(
BigInteger
value)
2719
public static
BigInteger
operator +(
BigInteger
value)
2725
public static
BigInteger
operator ++(
BigInteger
value)
2730
public static
BigInteger
operator --(
BigInteger
value)
2735
public static
BigInteger
operator +(
BigInteger
left,
BigInteger
right)
2748
public static
BigInteger
operator *(
BigInteger
left,
BigInteger
right)
2759
private static
BigInteger
Multiply(ReadOnlySpan<uint> left, int leftSign, ReadOnlySpan<uint> right, int rightSign)
2766
BigInteger
result;
2836
public static
BigInteger
operator /(
BigInteger
dividend,
BigInteger
divisor)
2894
var
result = new BigInteger(quotient, (dividend._sign < 0) ^ (divisor._sign < 0));
2903
public static
BigInteger
operator %(
BigInteger
dividend,
BigInteger
divisor)
2944
var
result = new BigInteger(bits, dividend._sign < 0);
2952
public static bool operator <(
BigInteger
left,
BigInteger
right)
2957
public static bool operator <=(
BigInteger
left,
BigInteger
right)
2962
public static bool operator >(
BigInteger
left,
BigInteger
right)
2966
public static bool operator >=(
BigInteger
left,
BigInteger
right)
2971
public static bool operator ==(
BigInteger
left,
BigInteger
right)
2976
public static bool operator !=(
BigInteger
left,
BigInteger
right)
2981
public static bool operator <(
BigInteger
left, long right)
2986
public static bool operator <=(
BigInteger
left, long right)
2991
public static bool operator >(
BigInteger
left, long right)
2996
public static bool operator >=(
BigInteger
left, long right)
3001
public static bool operator ==(
BigInteger
left, long right)
3006
public static bool operator !=(
BigInteger
left, long right)
3011
public static bool operator <(long left,
BigInteger
right)
3016
public static bool operator <=(long left,
BigInteger
right)
3021
public static bool operator >(long left,
BigInteger
right)
3026
public static bool operator >=(long left,
BigInteger
right)
3031
public static bool operator ==(long left,
BigInteger
right)
3036
public static bool operator !=(long left,
BigInteger
right)
3042
public static bool operator <(
BigInteger
left, ulong right)
3048
public static bool operator <=(
BigInteger
left, ulong right)
3054
public static bool operator >(
BigInteger
left, ulong right)
3060
public static bool operator >=(
BigInteger
left, ulong right)
3066
public static bool operator ==(
BigInteger
left, ulong right)
3072
public static bool operator !=(
BigInteger
left, ulong right)
3078
public static bool operator <(ulong left,
BigInteger
right)
3084
public static bool operator <=(ulong left,
BigInteger
right)
3090
public static bool operator >(ulong left,
BigInteger
right)
3096
public static bool operator >=(ulong left,
BigInteger
right)
3102
public static bool operator ==(ulong left,
BigInteger
right)
3108
public static bool operator !=(ulong left,
BigInteger
right)
3190
static
BigInteger
IAdditiveIdentity<
BigInteger
,
BigInteger
>.AdditiveIdentity => Zero;
3197
public static (
BigInteger
Quotient,
BigInteger
Remainder) DivRem(
BigInteger
left,
BigInteger
right)
3199
BigInteger
quotient = DivRem(left, right, out
BigInteger
remainder);
3204
public static
BigInteger
LeadingZeroCount(
BigInteger
value)
3220
public static
BigInteger
PopCount(
BigInteger
value)
3274
public static
BigInteger
RotateLeft(
BigInteger
value, int rotateAmount)
3295
public static
BigInteger
RotateRight(
BigInteger
value, int rotateAmount)
3315
private static
BigInteger
Rotate(ReadOnlySpan<uint> bits, bool negative, long rotateLeftAmount)
3364
var
result = new BigInteger(zd, negative);
3373
public static
BigInteger
TrailingZeroCount(
BigInteger
value)
3401
static bool IBinaryInteger<
BigInteger
>.TryReadBigEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
BigInteger
value)
3408
static bool IBinaryInteger<
BigInteger
>.TryReadLittleEndian(ReadOnlySpan<byte> source, bool isUnsigned, out
BigInteger
value)
3415
int IBinaryInteger<
BigInteger
>.GetShortestBitLength()
3464
int IBinaryInteger<
BigInteger
>.GetByteCount() => GetGenericMathByteCount();
3467
bool IBinaryInteger<
BigInteger
>.TryWriteBigEndian(Span<byte> destination, out int bytesWritten)
3569
bool IBinaryInteger<
BigInteger
>.TryWriteLittleEndian(Span<byte> destination, out int bytesWritten)
3714
static
BigInteger
IBinaryNumber<
BigInteger
>.AllBitsSet => MinusOne;
3717
public static bool IsPow2(
BigInteger
value) => value.IsPowerOfTwo;
3720
public static
BigInteger
Log2(
BigInteger
value)
3742
static
BigInteger
IMultiplicativeIdentity<
BigInteger
,
BigInteger
>.MultiplicativeIdentity => One;
3749
public static
BigInteger
Clamp(
BigInteger
value,
BigInteger
min,
BigInteger
max)
3780
public static
BigInteger
CopySign(
BigInteger
value,
BigInteger
sign)
3803
static
BigInteger
INumber<
BigInteger
>.MaxNumber(
BigInteger
x,
BigInteger
y) => Max(x, y);
3806
static
BigInteger
INumber<
BigInteger
>.MinNumber(
BigInteger
x,
BigInteger
y) => Min(x, y);
3809
static int INumber<
BigInteger
>.Sign(
BigInteger
value)
3826
static int INumberBase<
BigInteger
>.Radix => 2;
3830
public static
BigInteger
CreateChecked<TOther>(TOther value)
3833
BigInteger
result;
3835
if (typeof(TOther) == typeof(
BigInteger
))
3837
result = (
BigInteger
)(object)value;
3849
public static
BigInteger
CreateSaturating<TOther>(TOther value)
3852
BigInteger
result;
3854
if (typeof(TOther) == typeof(
BigInteger
))
3856
result = (
BigInteger
)(object)value;
3868
public static
BigInteger
CreateTruncating<TOther>(TOther value)
3871
BigInteger
result;
3873
if (typeof(TOther) == typeof(
BigInteger
))
3875
result = (
BigInteger
)(object)value;
3886
static bool INumberBase<
BigInteger
>.IsCanonical(
BigInteger
value) => true;
3889
static bool INumberBase<
BigInteger
>.IsComplexNumber(
BigInteger
value) => false;
3892
public static bool IsEvenInteger(
BigInteger
value)
3904
static bool INumberBase<
BigInteger
>.IsFinite(
BigInteger
value) => true;
3907
static bool INumberBase<
BigInteger
>.IsImaginaryNumber(
BigInteger
value) => false;
3910
static bool INumberBase<
BigInteger
>.IsInfinity(
BigInteger
value) => false;
3913
static bool INumberBase<
BigInteger
>.IsInteger(
BigInteger
value) => true;
3916
static bool INumberBase<
BigInteger
>.IsNaN(
BigInteger
value) => false;
3919
public static bool IsNegative(
BigInteger
value)
3926
static bool INumberBase<
BigInteger
>.IsNegativeInfinity(
BigInteger
value) => false;
3929
static bool INumberBase<
BigInteger
>.IsNormal(
BigInteger
value) => (value != 0);
3932
public static bool IsOddInteger(
BigInteger
value)
3944
public static bool IsPositive(
BigInteger
value)
3951
static bool INumberBase<
BigInteger
>.IsPositiveInfinity(
BigInteger
value) => false;
3954
static bool INumberBase<
BigInteger
>.IsRealNumber(
BigInteger
value) => true;
3957
static bool INumberBase<
BigInteger
>.IsSubnormal(
BigInteger
value) => false;
3960
static bool INumberBase<
BigInteger
>.IsZero(
BigInteger
value)
3967
public static
BigInteger
MaxMagnitude(
BigInteger
x,
BigInteger
y)
3977
static
BigInteger
INumberBase<
BigInteger
>.MaxMagnitudeNumber(
BigInteger
x,
BigInteger
y) => MaxMagnitude(x, y);
3980
public static
BigInteger
MinMagnitude(
BigInteger
x,
BigInteger
y)
3990
static
BigInteger
INumberBase<
BigInteger
>.MinMagnitudeNumber(
BigInteger
x,
BigInteger
y) => MinMagnitude(x, y);
3993
static
BigInteger
INumberBase<
BigInteger
>.MultiplyAddEstimate(
BigInteger
left,
BigInteger
right,
BigInteger
addend) => (left * right) + addend;
3997
static bool INumberBase<
BigInteger
>.TryConvertFromChecked<TOther>(TOther value, out
BigInteger
result) => TryConvertFromChecked(value, out result);
4000
private static bool TryConvertFromChecked<TOther>(TOther value, out
BigInteger
result)
4018
result = (
BigInteger
)actualValue;
4024
result = checked((
BigInteger
)actualValue);
4030
result = checked((
BigInteger
)actualValue);
4036
result = checked((
BigInteger
)actualValue);
4078
result = checked((
BigInteger
)actualValue);
4120
static bool INumberBase<
BigInteger
>.TryConvertFromSaturating<TOther>(TOther value, out
BigInteger
result) => TryConvertFromSaturating(value, out result);
4123
private static bool TryConvertFromSaturating<TOther>(TOther value, out
BigInteger
result)
4141
result = (
BigInteger
)actualValue;
4147
result = double.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4153
result = Half.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4159
result = BFloat16.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4201
result = float.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4243
static bool INumberBase<
BigInteger
>.TryConvertFromTruncating<TOther>(TOther value, out
BigInteger
result) => TryConvertFromTruncating(value, out result);
4246
private static bool TryConvertFromTruncating<TOther>(TOther value, out
BigInteger
result)
4264
result = (
BigInteger
)actualValue;
4270
result = double.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4276
result = Half.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4282
result = BFloat16.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4324
result = float.IsNaN(actualValue) ? Zero : (
BigInteger
)actualValue;
4366
static bool INumberBase<
BigInteger
>.TryConvertToChecked<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
4491
static bool INumberBase<
BigInteger
>.TryConvertToSaturating<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
4690
static bool INumberBase<
BigInteger
>.TryConvertToTruncating<TOther>(
BigInteger
value, [MaybeNullWhen(false)] out TOther result)
5095
public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
BigInteger
result) => TryParse(s, NumberStyles.Integer, provider, out result);
5102
public static
BigInteger
operator >>>(
BigInteger
value, int shiftAmount)
5203
BigInteger
result;
5232
static
BigInteger
ISignedNumber<
BigInteger
>.NegativeOne => MinusOne;
5239
public static
BigInteger
Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s, NumberStyles.Integer, provider);
5242
public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
BigInteger
result) => TryParse(s, NumberStyles.Integer, provider, out result);
5249
public static
BigInteger
Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text, NumberStyles.Integer, provider);
5252
public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
BigInteger
result) => TryParse(utf8Text, NumberStyles.Integer, provider, out result);
System\Numerics\Complex.cs (10)
793
public static explicit operator Complex(
BigInteger
value)
1751
else if (typeof(TOther) == typeof(
BigInteger
))
1758
BigInteger
actualResult = checked((
BigInteger
)value.m_real);
1930
else if (typeof(TOther) == typeof(
BigInteger
))
1932
BigInteger
actualResult = (
BigInteger
)value.m_real;
2072
else if (typeof(TOther) == typeof(
BigInteger
))
2074
BigInteger
actualResult = (
BigInteger
)value.m_real;
System.Security.Cryptography (34)
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\Asn1Reader\AsnValueReader.cs (2)
69
internal
BigInteger
ReadInteger(Asn1Tag? expectedTag = default)
71
BigInteger
ret = AsnDecoder.ReadInteger(_span, _ruleSet, out int consumed, expectedTag);
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)
37
internal static byte[] ExportKeyParameter(this
BigInteger
value, int length)
System\Security\Cryptography\X509Certificates\Asn1\CertificationRequestInfoAsn.xml.cs (1)
15
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 (3)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (2)
69
internal
BigInteger
ReadInteger(Asn1Tag? expectedTag = default)
71
BigInteger
ret = AsnDecoder.ReadInteger(_span, _ruleSet, out int consumed, expectedTag);
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)