153 references to BigIntegerCalculator
System.Runtime.Numerics (153)
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 (127)
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); 1659Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1660? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1663BigIntegerCalculator.Add(rightBits, NumericsHelpers.Abs(leftSign), bits); 1671Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1672? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1675BigIntegerCalculator.Add(leftBits, NumericsHelpers.Abs(rightSign), bits); 1683Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1684? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1687BigIntegerCalculator.Add(rightBits, leftBits, bits); 1695Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1696? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1699BigIntegerCalculator.Add(leftBits, rightBits, bits); 1737Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1738? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1741BigIntegerCalculator.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits); 1749Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1750? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1753BigIntegerCalculator.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits); 1756else if (BigIntegerCalculator.Compare(leftBits, rightBits) < 0) 1759Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1760? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1763BigIntegerCalculator.Subtract(rightBits, leftBits, bits); 1771Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1772? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1775BigIntegerCalculator.Subtract(leftBits, rightBits, bits); 2348Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2349? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2355Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2356? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2362Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2363? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2404Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2405? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2411Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2412? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2418Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2419? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2455Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2456? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2462Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2463? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2469Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2470? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2509Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2510? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2516Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2517? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2570Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 2571? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2598Span<uint> zd = ((uint)zl <= BigIntegerCalculator.StackAllocThreshold 2599? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2712Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2713? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2716BigIntegerCalculator.Multiply(right, NumericsHelpers.Abs(leftSign), bits); 2724Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2725? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2728BigIntegerCalculator.Multiply(left, NumericsHelpers.Abs(rightSign), bits); 2734Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2735? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2738BigIntegerCalculator.Square(left, bits); 2746Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2747? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2751BigIntegerCalculator.Multiply(right, left, bits); 2759Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2760? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2764BigIntegerCalculator.Multiply(left, right, bits); 2801Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2802? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2808BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient); 2827Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2828? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2831BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient); 2864uint remainder = BigIntegerCalculator.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign)); 2877Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2878? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2881BigIntegerCalculator.Remainder(dividend._bits, divisor._bits, bits); 3261Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3262? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3271Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3272? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3396Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold) 3397? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3406Span<uint> zd = (zl <= BigIntegerCalculator.StackAllocThreshold) 3407? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5244Span<uint> xd = (xl <= BigIntegerCalculator.StackAllocThreshold 5245? stackalloc uint[BigIntegerCalculator.StackAllocThreshold]