96 references to BigInteger
System.Private.CoreLib (96)
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; 946Debug.Assert((pow10BigNumTableIndex + ((sizeof(BigInteger) + sizeof(uint) - 1) / sizeof(uint))) < Pow10BigNumTable.Length); 948ref BigInteger rhs = ref Unsafe.As<uint, BigInteger>(ref Unsafe.AsRef(in Pow10BigNumTable[pow10BigNumTableIndex])); 953ref BigInteger temp = ref product; 966private static uint AddDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs) 1021private static uint SubtractDivisor(ref BigInteger lhs, int lhsStartIndex, ref BigInteger rhs, ulong q) 1118public void Multiply(scoped ref BigInteger value) 1126SetValue(out BigInteger temp, ref this); 1179Pow10(exponent, out BigInteger poweredValue); 1184public static void SetUInt32(out BigInteger result, uint value) 1199public static void SetUInt64(out BigInteger result, ulong value) 1216public static void SetValue(out BigInteger result, scoped ref BigInteger value) 1225public static void SetZero(out BigInteger result)
src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (37)
74BigInteger scale; // positive scale applied to value and margin such that they can be represented as whole numbers 75BigInteger scaledValue; // scale * mantissa 76BigInteger scaledMarginLow; // scale * 0.5 * (distance between this floating-point number and its immediate lower value) 80BigInteger optionalMarginHigh; 94BigInteger.SetUInt64(out scaledValue, 4 * mantissa); 98BigInteger.SetUInt32(out scale, 4); 101BigInteger.Pow2(exponent, out scaledMarginLow); 104BigInteger.Pow2(exponent + 1, out optionalMarginHigh); 111BigInteger.SetUInt64(out scaledValue, 4 * mantissa); 114BigInteger.Pow2(-exponent + 2, out scale); 117BigInteger.SetUInt32(out scaledMarginLow, 1); 120BigInteger.SetUInt32(out optionalMarginHigh, 2); 135BigInteger.SetUInt64(out scaledValue, 2 * mantissa); 139BigInteger.SetUInt32(out scale, 2); 142BigInteger.Pow2(exponent, out scaledMarginLow); 149BigInteger.SetUInt64(out scaledValue, 2 * mantissa); 152BigInteger.Pow2(-exponent + 1, out scale); 155BigInteger.SetUInt32(out scaledMarginLow, 1); 163scoped ref BigInteger scaledMarginHigh = ref (hasUnequalMargins ? ref optionalMarginHigh : ref scaledMarginLow); 193BigInteger.Pow10((uint)(-digitExponent), out BigInteger pow10); 200BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 213BigInteger.Add(ref scaledValue, ref scaledMarginHigh, out BigInteger scaledValueHigh); 214int cmpHigh = BigInteger.Compare(ref scaledValueHigh, ref scale); 219estimateTooLow = BigInteger.Compare(ref scaledValue, ref scale) >= 0; 238BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 297BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 317outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 321BigInteger.Add(ref scaledValue, ref scaledMarginHigh, out BigInteger scaledValueHigh); 324int cmpLow = BigInteger.Compare(ref scaledValue, ref scaledMarginLow); 325int cmpHigh = BigInteger.Compare(ref scaledValueHigh, ref scale); 353BigInteger.Multiply(ref scaledMarginLow, 2, out scaledMarginHigh); 370outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 398outputDigit = BigInteger.HeuristicDivide(ref scaledValue, ref scale); 427int compare = BigInteger.Compare(ref scaledValue, ref scale);
src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (16)
699private static void AccumulateDecimalDigitsIntoBigInteger(scoped ref NumberBuffer number, uint firstIndex, uint lastIndex, out BigInteger result) 701BigInteger.SetZero(out result); 725int initialMantissaBits = BigInteger.CountSignificantBits(initialMantissa); 838private static ulong ConvertBigIntegerToFloatingPointBits<TFloat>(ref BigInteger value, int integerBitsOfPrecision, bool hasNonZeroFractionalPart) 1073AccumulateDecimalDigitsIntoBigInteger(ref number, IntegerFirstIndex, integerLastIndex, out BigInteger integerValue); 1089int integerBitsOfPrecision = BigInteger.CountSignificantBits(ref integerValue); 1123AccumulateDecimalDigitsIntoBigInteger(ref number, fractionalFirstIndex, fractionalLastIndex, out BigInteger fractionalNumerator); 1134BigInteger.Pow10(fractionalDenominatorExponent, out BigInteger fractionalDenominator); 1142int fractionalNumeratorBits = BigInteger.CountSignificantBits(ref fractionalNumerator); 1143int fractionalDenominatorBits = BigInteger.CountSignificantBits(ref fractionalDenominator); 1193if (BigInteger.Compare(ref fractionalNumerator, ref fractionalDenominator) < 0) 1200BigInteger.DivRem(ref fractionalNumerator, ref fractionalDenominator, out BigInteger bigFractionalMantissa, out BigInteger fractionalRemainder); 1206int fractionalMantissaBits = BigInteger.CountSignificantBits(fractionalMantissa);