将数值转化为字符串
valueOf(数值)
[java]Math类的常用方法
[java]Math类的常用方法
abs(arg) : 返回arg绝对值,arg可以是:int,long,float,double. [例子]
Math.abs(-30.5) == 30.5
Math.abs(-100.0989) == 100.0989
ceil(double arg) : 返回>=arg的最小整数.
[例子]
Math.ceil(30.4) == 31.0
Math.ceil(-8.0989) == -8.0
floor(double arg) : 返回<=arg最大整数.
[例子]
Math.floor(30.4) == 30.0
Math.floor(-8.0989) == -9.0
max(x,y) : 返回x和y中的最大值.
min(x,y) : 返回x和y中的最小值.
rint(double arg) : 返回最接近arg的整数值. 返回double [例子]
Math.rint(30.4) == 30.0
Math.rint(30.5) == 31.0