「Java」BigDecimalのサンプルコード

サンプルコード
@Test
public void todeMathFuc(){
BigDecimal d = new BigDecimal(“123");
BigDecimal e = new BigDecimal(“14455552");
System.out.println(Math.pow(123, 12));
System.out.println(d.pow(12));

System.out.println(Math.ceil(12.3));//13.0
System.out.println(Math.floor(-12.3));// -13.0
System.out.println(Math.round(13.3));//13
System.out.println(Math.round(-13.5));//-13
System.out.println(Math.round(-13.2));//-13
System.out.println(Math.round(-13.7));/-14
}

Java

Posted by arkgame