@Test public void testExactDivideSmallExhaustive() { for (int a = 10; a >= -10; --a) { for (int b = 10; b >= -10; --b) { int p = a * b; BigInteger aVal = BigInteger.valueOf(a); BigInteger bVal = BigInteger.valueOf(b); BigInteger pVal = BigInteger.valueOf(p); if (a != 0) { assertEquals(String.format("a %d, b %d, p %d", a, b, p), bVal, exactDivide(pVal, aVal)); } else { try { exactDivide(pVal, aVal); fail("ArithmeticException expected"); } catch (ArithmeticException expected) { } } } } }
public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) { if (divisor.signum() == 0) { throw new ArithmeticException("BigInteger divide by zero"); } return INSTANCE.get().exactDivImpl(dividend, divisor); }
Gmp { public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) { if (divisor.signum() == 0) { throw new ArithmeticException("BigInteger divide by zero"); } return INSTANCE.get().exactDivImpl(dividend, divisor); } }
Gmp { public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) { if (divisor.signum() == 0) { throw new ArithmeticException("BigInteger divide by zero"); } return INSTANCE.get().exactDivImpl(dividend, divisor); } private  Gmp(); }
Gmp { public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) { if (divisor.signum() == 0) { throw new ArithmeticException("BigInteger divide by zero"); } return INSTANCE.get().exactDivImpl(dividend, divisor); } private  Gmp(); static void checkLoaded(); static int kronecker(BigInteger a, BigInteger p); static BigInteger modPowInsecure(BigInteger base, BigInteger exponent,
      BigInteger modulus); static BigInteger modPowSecure(BigInteger base, BigInteger exponent, BigInteger modulus); static BigInteger modInverse(BigInteger val, BigInteger modulus); static BigInteger exactDivide(BigInteger dividend, BigInteger divisor); static BigInteger gcd(BigInteger value1, BigInteger value2); }
Gmp { public static BigInteger exactDivide(BigInteger dividend, BigInteger divisor) { if (divisor.signum() == 0) { throw new ArithmeticException("BigInteger divide by zero"); } return INSTANCE.get().exactDivImpl(dividend, divisor); } private  Gmp(); static void checkLoaded(); static int kronecker(BigInteger a, BigInteger p); static BigInteger modPowInsecure(BigInteger base, BigInteger exponent,
      BigInteger modulus); static BigInteger modPowSecure(BigInteger base, BigInteger exponent, BigInteger modulus); static BigInteger modInverse(BigInteger val, BigInteger modulus); static BigInteger exactDivide(BigInteger dividend, BigInteger divisor); static BigInteger gcd(BigInteger value1, BigInteger value2);  }