Code example for BigInteger

Methods: multiply, pow

0
 
    /** 
     * @tests java.math.BigInteger#pow(int) 
     */ 
    public void test_powI() { 
        assertTrue("Incorrect exponent returned for 2**10", two.pow(10).equals(
                twoToTheTen));
        assertTrue("Incorrect exponent returned for 2**70", two.pow(30)
                .multiply(two.pow(40)).equals(twoToTheSeventy));
        assertTrue("Incorrect exponent returned for 10**50", ten.pow(50)
                .equals(aZillion));
    } 
 
    /** 
     * @tests java.math.BigInteger#modInverse(java.math.BigInteger) 
     */ 
    public void test_modInverseLjava_math_BigInteger() { 
        BigInteger a = zero, mod, inv;
        for (int j = 3; j < 50; j++) {
            mod = BigInteger.valueOf(j);
            for (int i = -j + 1; i < j; i++) {