public static BigInteger Modulus(Rational n, BigInteger p)
 {
     if (n.IsInteger)
     {
         return(IntegerMath.Modulus((BigInteger)n, p));
     }
     return(IntegerMath.ModularQuotient(n.Numerator, n.Denominator, p));
 }
        private void Sieve(int p)
        {
            int q = Math.Max(IntegerMath.Modulus(-m, p), 2 * p - m);

            for (int i = q; i < n; i += p)
            {
                bits[i] = true;
            }
        }
Exemple #3
0
 public override Rational Modulo(Rational a, Rational b)
 {
     return(IntegerMath.Modulus(a, (BigInteger)b));
 }