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