Code example for BigDecimal

Methods: doubleValuescale

0
        assertTrue("the double representation is not correct for 1.2345E-12",
                big.doubleValue() == 1.2345E-12);
        big = new BigDecimal(-12345E-3);
        assertTrue("the double representation is not correct for -12345E-3",
                big.doubleValue() == -12.345);
        big = new BigDecimal(5.1234567897654321e138);
        assertTrue("the double representation is not correct for 5.1234567897654321e138", big
                .doubleValue() == 5.1234567897654321E138
                && big.scale() == 0);
        big = new BigDecimal(0.1);
        assertTrue("the double representation of 0.1 bigDecimal is not correct",
                big.doubleValue() == 0.1);
        big = new BigDecimal(0.00345);
        assertTrue("the double representation of 0.00345 bigDecimal is not correct", big
                .doubleValue() == 0.00345);
        // regression test for HARMONY-2429 
        big = new BigDecimal(-0.0);
        assertTrue("the double representation of -0.0 bigDecimal is not correct", big.scale() == 0);
    } 
 
    /**