155 references to BigIntegerCalculator
System.Runtime.Numerics (155)
System\Number.BigInteger.cs (26)
350base1E9Length <= BigIntegerCalculator.StackAllocThreshold 351? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 376resultLength <= BigIntegerCalculator.StackAllocThreshold 377? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 409powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 410? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 421leadingLength <= BigIntegerCalculator.StackAllocThreshold 422? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 427leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 448base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 468bufferLength <= BigIntegerCalculator.StackAllocThreshold 469? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 475ReadOnlySpan<uint> buffer2 = buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer)); 478BigIntegerCalculator.Multiply(buffer2, multiplier, bitsUpper); 480BigIntegerCalculator.Multiply(multiplier, buffer2, bitsUpper); 486BigIntegerCalculator.AddSelf(bits, buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer))); 794Span<uint> base1E9Buffer = cuMax < BigIntegerCalculator.StackAllocThreshold ? 1073BigIntegerCalculator.Square(src, dst); 1117BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1124bits.Length <= BigIntegerCalculator.StackAllocThreshold 1125? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1161BigIntegerCalculator.Multiply(src, power, dst); 1163BigIntegerCalculator.Multiply(power, src, dst); 1181BigIntegerCalculator.Multiply(powersOfTen, left, bits2); 1183BigIntegerCalculator.Multiply(left, powersOfTen, bits2);
System\Numerics\BigInteger.cs (129)
777Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 778? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 784BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient, out rest); 807Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 808? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 813Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 814? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 817BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient, rest); 884return BigIntegerCalculator.Gcd(NumericsHelpers.Abs(left._sign), NumericsHelpers.Abs(right._sign)); 891? BigIntegerCalculator.Gcd(right._bits, NumericsHelpers.Abs(left._sign)) 899? BigIntegerCalculator.Gcd(left._bits, NumericsHelpers.Abs(right._sign)) 905if (BigIntegerCalculator.Compare(left._bits, right._bits) < 0) 917Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 925uint temp = BigIntegerCalculator.Remainder(leftBits, rightBits[0]); 926result = BigIntegerCalculator.Gcd(rightBits[0], temp); 930Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 931? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 934BigIntegerCalculator.Remainder(leftBits, rightBits, bits); 939result = BigIntegerCalculator.Gcd(left, right); 943Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 944? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 947BigIntegerCalculator.Gcd(leftBits, rightBits, bits); 987uint bits = trivialValue && trivialExponent ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 988trivialValue ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, NumericsHelpers.Abs(modulus._sign)) : 989trivialExponent ? BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 990BigIntegerCalculator.Pow(value._bits!, exponent._bits!, NumericsHelpers.Abs(modulus._sign)); 998Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 999? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1006BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1010BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, modulus._bits!, bits); 1015BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1019BigIntegerCalculator.Pow(value._bits!, exponent._bits!, modulus._bits!, bits); 1057int size = BigIntegerCalculator.PowBound(power, 1); 1058Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1059? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1063BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), power, bits); 1068int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1069Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1070? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1074BigIntegerCalculator.Pow(value._bits, power, bits); 1200int bitsResult = BigIntegerCalculator.Compare(_bits, other._bits); 1686Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1687? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1690BigIntegerCalculator.Add(rightBits, NumericsHelpers.Abs(leftSign), bits); 1698Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1699? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1702BigIntegerCalculator.Add(leftBits, NumericsHelpers.Abs(rightSign), bits); 1710Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1711? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1714BigIntegerCalculator.Add(rightBits, leftBits, bits); 1722Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1723? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1726BigIntegerCalculator.Add(leftBits, rightBits, bits); 1764Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1765? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1768BigIntegerCalculator.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits); 1776Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1777? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1780BigIntegerCalculator.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits); 1783else if (BigIntegerCalculator.Compare(leftBits, rightBits) < 0) 1786Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1787? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1790BigIntegerCalculator.Subtract(rightBits, leftBits, bits); 1798Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1799? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1802BigIntegerCalculator.Subtract(leftBits, rightBits, bits); 2375Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2376? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2382Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2383? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2389Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2390? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2431Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2432? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2438Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2439? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2445Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2446? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2482Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2483? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2489Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2490? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2496Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2497? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2536Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2537? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2543Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2544? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2597Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2598? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2625Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2626? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2739Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2740? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2743BigIntegerCalculator.Multiply(right, NumericsHelpers.Abs(leftSign), bits); 2751Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2752? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2755BigIntegerCalculator.Multiply(left, NumericsHelpers.Abs(rightSign), bits); 2761Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2762? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2765BigIntegerCalculator.Square(left, bits); 2773Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2774? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2778BigIntegerCalculator.Multiply(right, left, bits); 2786Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2787? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2791BigIntegerCalculator.Multiply(left, right, bits); 2828Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2829? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2835BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient); 2854Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2855? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2858BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient); 2891uint remainder = BigIntegerCalculator.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign)); 2904Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2905? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2908BigIntegerCalculator.Remainder(dividend._bits, divisor._bits, bits); 3306Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3307? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3317Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3318? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3461Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3462? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3472Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3473? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5322Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 5323? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5341Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 5342? stackalloc uint[BigIntegerCalculator.StackAllocThreshold]