Code example for BigDecimal

Methods: doubleValue, subtract

0
				result.equals(result2.negate()));
		sub1 = new BigDecimal(value, 1);
		sub2 = new BigDecimal("0");
		result = sub1.subtract(sub2);
		assertTrue("1234590.8 - 0 is wrong", result.equals(sub1));
		sub1 = new BigDecimal(1.234E-03);
		sub2 = new BigDecimal(3.423E-10);
		result = sub1.subtract(sub2);
		assertTrue("1.234E-03 - 3.423E-10 is wrong, " + result.doubleValue(),
				result.doubleValue() == 0.0012339996577);
		sub1 = new BigDecimal(1234.0123);
		sub2 = new BigDecimal(1234.0123000);
		result = sub1.subtract(sub2);
		assertTrue("1234.0123 - 1234.0123000 is wrong, " + result.doubleValue(),
				result.doubleValue() == 0.0);
	} 
 
	/** 
	 * @tests java.math.BigDecimal#toBigInteger() 
	 */ 
	public void test_toBigInteger() {