output:
//取整,返回小于目标数的最大整数 System.out.println(Math.floor(-1.2)); // 取整,返回在于目标数的最大整数 System.out.println(Math.ceil(1.2)); // 四舍五入取整 System.out.println(Math.round(1.6)); System.out.println(Math.round(1.5)); System.out.println(Math.round(1.4)); System.out.println(Math.IEEEremainder(5,3)); System.out.println(Math.IEEEremainder(5,2)); //计算平方 System.out.println(Math.pow(3,4)); //计得平方根 System.out.println(Math.sqrt(4)); // 计算立方根 System.out.println(Math.cbrt(27)); System.out.println(Math.copySign(1.2,-1.0)); System.out.println(Math.nextAfter(1.4,1.0)); System.out.println(Math.nextUp(1.3));
-2.02.0221-1.01.081.02.03.0-1.21.39999999999999971.3000000000000003