Code example for BigDecimal

Methods: equals

		equal1 = new BigDecimal("1.00");
		equal2 = new BigDecimal(val, 2);
		assertTrue("1.00(string) and 1.00(bigInteger) should be equal", equal1
		equal1 = new BigDecimal(100D);
		equal2 = new BigDecimal("2.34576");
		assertFalse("100D and 2.34576 should not be equal", equal1
		assertFalse("bigDecimal 100D does not equal string 23415", equal1
	 * @tests java.math.BigDecimal#floatValue() 
	public void test_floatValue() { 
		BigDecimal fl1 = new BigDecimal("234563782344567");
		assertTrue("the float representation of bigDecimal 234563782344567",
				fl1.floatValue() == 234563782344567f);
		BigDecimal fl2 = new BigDecimal(2.345E37);
Connect your IDE to all the code out there  Get Codota for Java