Code example for BigDecimal

Methods: signum

0
		BigDecimal sign = new BigDecimal(123E-104);
		assertTrue("123E-104 is not positive in signum()", sign.signum() == 1);
		sign = new BigDecimal("-1234.3959");
		assertTrue("-1234.3959 is not negative in signum()",
				sign.signum() == -1);
		sign = new BigDecimal(000D);
		assertTrue("000D is not zero in signum()", sign.signum() == 0);
	} 
 
	/** 
	 * @tests java.math.BigDecimal#subtract(java.math.BigDecimal) 
	 */ 
	public void test_subtractLjava_math_BigDecimal() { 
		BigDecimal sub1 = new BigDecimal("13948");
		BigDecimal sub2 = new BigDecimal("2839.489");
		BigDecimal result = sub1.subtract(sub2);
		assertTrue("13948 - 2839.489 is wrong: " + result, result.toString()
				.equals("11108.511")
				&& result.scale() == 3);
		BigDecimal result2 = sub2.subtract(sub1);
		assertTrue("2839.489 - 13948 is wrong", result2.toString().equals(