Code example for BigDecimal

Methods: multiply

0
 
		// テスト2 
 
		BigDecimal bd1 = new BigDecimal(12345667890.12345667890);
		BigDecimal bd2 = new BigDecimal(12345667890.12345667890);
		BigDecimal bd3 = new BigDecimal(12345667890.12345667890);
 
		BigDecimal answerB = (bd1.multiply(bd2)).multiply(bd3);
 
		System.out.println("B:" + answerB);
		System.out.println("B:" + answerB.toPlainString());
		System.out.println("-------------");
 
		d1 = 1.1;
		d2 = 2.2;
 
		System.out.println("1.1 + 2.2 = " + (d1+d2));
		System.out.println("-------------");
	} 
 
}