Code example for BigDecimal

Methods: floatValue

0
				.floatValue() == -3E12F);
		fl2 = new BigDecimal(Double.MAX_VALUE);
		assertTrue(
				"A number can't be represented by float should return infinity", 
				fl2.floatValue() == Float.POSITIVE_INFINITY);
		fl2 = new BigDecimal(-Double.MAX_VALUE);
		assertTrue(
				"A number can't be represented by float should return infinity", 
				fl2.floatValue() == Float.NEGATIVE_INFINITY);
 
	} 
 
	/** 
	 * @tests java.math.BigDecimal#hashCode() 
	 */ 
	public void test_hashCode() { 
		// anything that is equal must have the same hashCode 
		BigDecimal hash = new BigDecimal("1.00");
		BigDecimal hash2 = new BigDecimal(1.00D);
		assertTrue("the hashCode of 1.00 and 1.00D is equal",
				hash.hashCode() != hash2.hashCode() && !hash.equals(hash2));