Code example for BigInteger

Methods: longValue

0
    /** 
     * @tests java.math.BigInteger#longValue() 
     */ 
    public void test_longValue() { 
        assertTrue("Incorrect longValue for 2**70",
                twoToTheSeventy.longValue() == 0);
        assertTrue("Incorrect longValue for 2", two.longValue() == 2);
    } 
 
    /** 
     * @tests java.math.BigInteger#valueOf(long) 
     */ 
    public void test_valueOfJ() { 
        assertTrue("Incurred number returned for 2", BigInteger.valueOf(2L)
                .equals(two));
        assertTrue("Incurred number returned for 200", BigInteger.valueOf(200L)
                .equals(BigInteger.valueOf(139).add(BigInteger.valueOf(61))));
    } 
 
    /** 
     * @tests java.math.BigInteger#add(java.math.BigInteger)