Code example for BigDecimal

Methods: doubleValue, multiply

0
		multi2 = new BigDecimal("-2");
		result = multi1.multiply(multi2);
		assertTrue("34656 * 2 is not correct", result.toString().equals(
				"-69312") 
				&& result.scale() == 0);
		multi1 = new BigDecimal(-2.345E-02);
		multi2 = new BigDecimal(-134E130);
		result = multi1.multiply(multi2);
		assertTrue("-2.345E-02 * -134E130 is not correct " + result.doubleValue(),
				result.doubleValue() == 3.1422999999999997E130
						&& result.scale() == multi1.scale() + multi2.scale());
		multi1 = new BigDecimal("11235");
		multi2 = new BigDecimal("0");
		result = multi1.multiply(multi2);
		assertTrue("11235 * 0 is not correct", result.doubleValue() == 0
				&& result.scale() == 0);
		multi1 = new BigDecimal("-0.00234");
		multi2 = new BigDecimal(13.4E10);
		result = multi1.multiply(multi2);
		assertTrue("-0.00234 * 13.4E10 is not correct",
				result.doubleValue() == -313560000