关于Math.round()函数:
用于对float、double类型的四舍五入。
基本格式:
Math.round(float a);返回值为int类型;
Math.round(double b);返回值为long类型;
若遇到几几点五这种会取离值较大的数。
如Math.round(12.5)=13;
Math.round(-12.5)=-12;
关于Math.pow()函数:
用于求一个数的次方。
基本格式:
Math.pow(x,a);求的是x的a次方,返回值为double类型。
如Math.pow(2,3)=8;
上代码:
忍耐和坚持是痛苦的,但它会逐给你好处。