java中Math方法

java.lang.Math.max(参数1,参数2)是一个静态的工具方法,主要用来比较两个相同类型参数的大小,支持的类型有double,float,int,long四种类型。

Math.sqrt()//计算平方根
Math.cbrt()//计算立方根 Math.pow(a, b)//计算a的b次方 Math.max( , );//计算最大值 Math.min( , );//计算最小值

猜你喜欢

转载自www.cnblogs.com/sgbe/p/11412579.html