JAVA-Math类

关于数学相关的一个类,主要包含了一些数学公式,求绝对值,最大值最小值,和堆角度的操作的方法。
(Math.cbrt(27));//立方根
double result = 0;
result = Math.ceil(2.2);//天花板,返回大于等于实际参数的正整数的值
result = Math.floor(2.6);//地板,返回小于等于实际参数的正整数的值
求最大值
Math.max(1.0, 4.5);
求23次幂
result = Math.pow(2, 3);
四舍五入
result = Math.round(4.4);
求平方根
result = Math.sqrt(16);

猜你喜欢

转载自blog.csdn.net/qq_37131111/article/details/78824189