112 references to BigInteger
System.Private.CoreLib (112)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (43)
323public static void Add(scoped ref BigInteger lhs, scoped ref BigInteger rhs, out BigInteger result) 328ref BigInteger large = ref (lhs._length < rhs._length) ? ref rhs : ref lhs; 329ref BigInteger small = ref (lhs._length < rhs._length) ? ref lhs : ref rhs; 390public static int Compare(scoped ref BigInteger lhs, scoped ref BigInteger rhs) 434public static int CountSignificantBits(ref BigInteger value) 448public static void DivRem(scoped ref BigInteger lhs, scoped ref BigInteger rhs, out BigInteger quo, out BigInteger rem) 642public static uint HeuristicDivide(ref BigInteger dividend, ref BigInteger divisor) 722public static void Multiply(scoped ref BigInteger lhs, uint value, out BigInteger result) 781public static void Multiply(scoped ref BigInteger lhs, scoped ref BigInteger rhs, out BigInteger result) 797ref readonly BigInteger large = ref lhs; 800ref readonly BigInteger small = ref rhs; 866public static void Pow2(int exponent, out BigInteger result) 892public static void Pow10(uint exponent, out BigInteger result) 924SetUInt32(out BigInteger temp1, Pow10UInt32Table[(int)(exponent & 0x7)]); 925ref BigInteger lhs = ref temp1; 927SetZero(out BigInteger temp2); 928ref BigInteger product = ref temp2; 944Debug.Assert((pow10BigNumTableIndex + ((sizeof(BigInteger) + sizeof(uint) - 1) / sizeof(uint))) < Pow10BigNumTable.Length); 946ref BigInteger rhs = ref Unsafe.As<uint, BigInteger>(ref Unsafe.AsRef(in Pow10BigNumTable[pow10BigNumTableIndex])); 950ref BigInteger temp = ref product; 963private static uint AddDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs) 1018private static uint SubtractDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs, ulong q) 1115public void Multiply(scoped ref BigInteger value) 1123SetValue(out BigInteger temp, ref this); 1176Pow10(exponent, out BigInteger poweredValue); 1181public static void SetUInt32(out BigInteger result, uint value) 1196public static void SetUInt64(out BigInteger result, ulong value) 1213public static void SetValue(out BigInteger result, scoped ref BigInteger value) 1222public static void SetZero(out BigInteger result)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (37)
80BigInteger scale; // positive scale applied to value and margin such that they can be represented as whole numbers 81BigInteger scaledValue; // scale * mantissa 82BigInteger scaledMarginLow; // scale * 0.5 * (distance between this floating-point number and its immediate lower value) 86BigInteger optionalMarginHigh; 100BigInteger.SetUInt64(out scaledValue, 4 * mantissa); 104BigInteger.SetUInt32(out scale, 4); 107BigInteger.Pow2(exponent, out scaledMarginLow); 110BigInteger.Pow2(exponent + 1, out optionalMarginHigh); 117BigInteger.SetUInt64(out scaledValue, 4 * mantissa); 120BigInteger.Pow2(-exponent + 2, out scale); 123BigInteger.SetUInt32(out scaledMarginLow, 1); 126BigInteger.SetUInt32(out optionalMarginHigh, 2); 141BigInteger.SetUInt64(out scaledValue, 2 * mantissa); 145BigInteger.SetUInt32(out scale, 2); 148BigInteger.Pow2(exponent, out scaledMarginLow); 155BigInteger.SetUInt64(out scaledValue, 2 * mantissa); 158BigInteger.Pow2(-exponent + 1, out scale); 161BigInteger.SetUInt32(out scaledMarginLow, 1); 169scoped ref BigInteger scaledMarginHigh = ref (hasUnequalMargins ? ref optionalMarginHigh : ref scaledMarginLow); 199BigInteger.Pow10((uint)(-digitExponent), out BigInteger pow10); 206BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 219BigInteger.Add(ref scaledValue, ref scaledMarginHigh, out BigInteger scaledValueHigh); 220int cmpHigh = BigInteger.Compare(ref scaledValueHigh, ref scale); 225estimateTooLow = BigInteger.Compare(ref scaledValue, ref scale) >= 0; 244BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 303BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 323outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 327BigInteger.Add(ref scaledValue, ref scaledMarginHigh, out BigInteger scaledValueHigh); 330int cmpLow = BigInteger.Compare(ref scaledValue, ref scaledMarginLow); 331int cmpHigh = BigInteger.Compare(ref scaledValueHigh, ref scale); 359BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 376outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 404outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 437int compare = BigInteger.Compare(ref scaledValue, ref scale);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (16)
700internal static void AccumulateDecimalDigitsIntoBigInteger(scoped ref NumberBuffer number, uint firstIndex, uint lastIndex, out BigInteger result) 702BigInteger.SetZero(out result); 726int initialMantissaBits = BigInteger.CountSignificantBits(initialMantissa); 839private static ulong ConvertBigIntegerToFloatingPointBits<TFloat>(ref BigInteger value, int integerBitsOfPrecision, bool hasNonZeroFractionalPart) 1082AccumulateDecimalDigitsIntoBigInteger(ref number, IntegerFirstIndex, integerLastIndex, out BigInteger integerValue); 1098int integerBitsOfPrecision = BigInteger.CountSignificantBits(ref integerValue); 1132AccumulateDecimalDigitsIntoBigInteger(ref number, fractionalFirstIndex, fractionalLastIndex, out BigInteger fractionalNumerator); 1143BigInteger.Pow10(fractionalDenominatorExponent, out BigInteger fractionalDenominator); 1151int fractionalNumeratorBits = BigInteger.CountSignificantBits(ref fractionalNumerator); 1152int fractionalDenominatorBits = BigInteger.CountSignificantBits(ref fractionalDenominator); 1202if (BigInteger.Compare(ref fractionalNumerator, ref fractionalDenominator) < 0) 1209BigInteger.DivRem(ref fractionalNumerator, ref fractionalDenominator, out BigInteger bigFractionalMantissa, out BigInteger fractionalRemainder); 1215int fractionalMantissaBits = BigInteger.CountSignificantBits(fractionalMantissa);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Rounding.cs (15)
321BigInteger.SetUInt64(out BigInteger numerator, mantissa); 322BigInteger denominator; 328BigInteger.SetUInt32(out denominator, 1); 333BigInteger.Pow2(-exponent, out denominator); 336BigInteger.DivRem(ref numerator, ref denominator, out BigInteger quotient, out BigInteger remainder); 344int midpointComparison = BigInteger.Compare(ref remainder, ref denominator); 401BigInteger.SetUInt32(out BigInteger ten, 10); 406BigInteger.DivRem(ref quotient, ref ten, out BigInteger newQuotient, out BigInteger digit); 409BigInteger.SetValue(out quotient, ref newQuotient);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (1)
1752Number.AccumulateDecimalDigitsIntoBigInteger(ref number, 0, (uint)digits, out Number.BigInteger result);