155 references to BigIntegerCalculator
System.Runtime.Numerics (155)
System\Number.BigInteger.cs (34)
358base1E9Length <= BigIntegerCalculator.StackAllocThreshold 359? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 384resultLength <= BigIntegerCalculator.StackAllocThreshold 385? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 417(uint)powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 418? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 429leadingLength <= BigIntegerCalculator.StackAllocThreshold 430? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 435leading = leading.Slice(0, BigIntegerCalculator.ActualLength(leading)); 456base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 476bufferLength <= BigIntegerCalculator.StackAllocThreshold 477? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 483ReadOnlySpan<uint> buffer2 = buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer)); 485BigIntegerCalculator.Multiply(buffer2, multiplier, bitsUpper); 491BigIntegerCalculator.AddSelf(bits, buffer.Slice(0, BigIntegerCalculator.ActualLength(buffer))); 817Span<uint> base1E9Buffer = ((uint)base1E9BufferLength <= BigIntegerCalculator.StackAllocThreshold ? 973int ToStringNaiveThreshold = BigIntegerCalculator.DivideBurnikelZieglerThreshold; 987powersOf1e9BufferLength <= BigIntegerCalculator.StackAllocThreshold 988? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1015while (bits.Length < powOfTen.Length + omittedLength || BigIntegerCalculator.Compare(bits.Slice(omittedLength), powOfTen) < 0) 1024Span<uint> upper = ((uint)upperLength <= BigIntegerCalculator.StackAllocThreshold 1025? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1030Span<uint> lower = ((uint)lowerLength <= BigIntegerCalculator.StackAllocThreshold 1031? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1035BigIntegerCalculator.Divide(bits.Slice(omittedLength), powOfTen, upper, lower.Slice(omittedLength)); 1044lower.Slice(0, BigIntegerCalculator.ActualLength(lower)), 1056upper.Slice(0, BigIntegerCalculator.ActualLength(upper)), 1229BigIntegerCalculator.Square(src, dst); 1297BigIntegerCalculator.Multiply(left, UInt32PowersOfTen[trailingZeroCount], bits.Slice(0, left.Length + 1)); 1304bits.Length <= BigIntegerCalculator.StackAllocThreshold 1305? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1340BigIntegerCalculator.Multiply(src, power, dst); 1358BigIntegerCalculator.Multiply(left, powersOfTen, bits2);
System\Numerics\BigInteger.cs (116)
797Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 798? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 804BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient, out rest); 827Span<uint> rest = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 828? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 833Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 834? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 837BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient, rest); 904return BigIntegerCalculator.Gcd(NumericsHelpers.Abs(left._sign), NumericsHelpers.Abs(right._sign)); 911? BigIntegerCalculator.Gcd(right._bits, NumericsHelpers.Abs(left._sign)) 919? BigIntegerCalculator.Gcd(left._bits, NumericsHelpers.Abs(right._sign)) 925if (BigIntegerCalculator.Compare(left._bits, right._bits) < 0) 937Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 945uint temp = BigIntegerCalculator.Remainder(leftBits, rightBits[0]); 946result = BigIntegerCalculator.Gcd(rightBits[0], temp); 950Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 951? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 954BigIntegerCalculator.Remainder(leftBits, rightBits, bits); 959result = BigIntegerCalculator.Gcd(left, right); 963Span<uint> bits = (leftBits.Length <= BigIntegerCalculator.StackAllocThreshold 964? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 967BigIntegerCalculator.Gcd(leftBits, rightBits, bits); 1007uint bits = trivialValue && trivialExponent ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 1008trivialValue ? BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, NumericsHelpers.Abs(modulus._sign)) : 1009trivialExponent ? BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), NumericsHelpers.Abs(modulus._sign)) : 1010BigIntegerCalculator.Pow(value._bits!, exponent._bits!, NumericsHelpers.Abs(modulus._sign)); 1018Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1019? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1026BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1030BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), exponent._bits!, modulus._bits!, bits); 1035BigIntegerCalculator.Pow(value._bits!, NumericsHelpers.Abs(exponent._sign), modulus._bits!, bits); 1039BigIntegerCalculator.Pow(value._bits!, exponent._bits!, modulus._bits!, bits); 1077int size = BigIntegerCalculator.PowBound(power, 1); 1078Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1079? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1083BigIntegerCalculator.Pow(NumericsHelpers.Abs(value._sign), power, bits); 1088int size = BigIntegerCalculator.PowBound(power, value._bits!.Length); 1089Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1090? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1094BigIntegerCalculator.Pow(value._bits, power, bits); 1220int bitsResult = BigIntegerCalculator.Compare(_bits, other._bits); 1711Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1712? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1715BigIntegerCalculator.Add(rightBits, NumericsHelpers.Abs(leftSign), bits); 1723Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1724? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1727BigIntegerCalculator.Add(leftBits, NumericsHelpers.Abs(rightSign), bits); 1735Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1736? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1739BigIntegerCalculator.Add(rightBits, leftBits, bits); 1747Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 1748? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1751BigIntegerCalculator.Add(leftBits, rightBits, bits); 1789Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1790? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1793BigIntegerCalculator.Subtract(rightBits, NumericsHelpers.Abs(leftSign), bits); 1801Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1802? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1805BigIntegerCalculator.Subtract(leftBits, NumericsHelpers.Abs(rightSign), bits); 1808else if (BigIntegerCalculator.Compare(leftBits, rightBits) < 0) 1811Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1812? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1815BigIntegerCalculator.Subtract(rightBits, leftBits, bits); 1823Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 1824? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 1827BigIntegerCalculator.Subtract(leftBits, rightBits, bits); 2416Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2417? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2423Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2424? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2430Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2431? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2472Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2473? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2479Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2480? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2486Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2487? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2523Span<uint> x = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2524? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2530Span<uint> y = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2531? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2537Span<uint> z = (size <= BigIntegerCalculator.StackAllocThreshold 2538? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2604BigIntegerCalculator.LeftShiftSelf(zd, smallShift, out uint carry); 2680Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 2681? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2687BigIntegerCalculator.RightShiftSelf(zd, smallShift, out uint carry); 2774Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2775? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2778BigIntegerCalculator.Multiply(right, NumericsHelpers.Abs(leftSign), bits); 2786Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2787? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2790BigIntegerCalculator.Multiply(left, NumericsHelpers.Abs(rightSign), bits); 2796Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2797? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2801BigIntegerCalculator.Square(left, bits); 2809Span<uint> bits = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2810? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2814BigIntegerCalculator.Multiply(left, right, bits); 2851Span<uint> quotient = ((uint)size <= BigIntegerCalculator.StackAllocThreshold 2852? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2858BigIntegerCalculator.Divide(dividend._bits, NumericsHelpers.Abs(divisor._sign), quotient); 2877Span<uint> quotient = ((uint)size < BigIntegerCalculator.StackAllocThreshold 2878? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2881BigIntegerCalculator.Divide(dividend._bits, divisor._bits, quotient); 2914uint remainder = BigIntegerCalculator.Remainder(dividend._bits, NumericsHelpers.Abs(divisor._sign)); 2927Span<uint> bits = (size <= BigIntegerCalculator.StackAllocThreshold 2928? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 2931BigIntegerCalculator.Remainder(dividend._bits, divisor._bits, bits); 3324Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 3325? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 3341BigIntegerCalculator.RotateLeft(zd, rotateLeftAmount); 5162Span<uint> zd = ((uint)zLength <= BigIntegerCalculator.StackAllocThreshold 5163? stackalloc uint[BigIntegerCalculator.StackAllocThreshold] 5188BigIntegerCalculator.RightShiftSelf(zd, smallShift, out _);
System\Numerics\BigIntegerCalculator.SquMul.cs (5)
723BigIntegerCalculator.Square(p0, r0); 724BigIntegerCalculator.Square(p1, r1); 725BigIntegerCalculator.Square(pm1, rm1); 726BigIntegerCalculator.Square(pm2, rm2); 727BigIntegerCalculator.Square(pInf, rInf);