Math类:
常用方法:
1.abs(double a)返回double值的绝对值
System.out.println(Math.abs(-12.3)); //12.3
2.random(); 返回0到1之间的随机数
System.out.println(Math.random());
3.sqrt(double b):开平方根
System.out.println(Math.sqrt(4));//2.0
4.round(double d):返回最接近d的值,四舍五入
System.out.println(Math.round(12.6));//13
5 max(double a,double b):返回较大的值
System.out.println(Math.min(12.323,23.232)); //12.323
6.min(double a,double b):返回较小的值
System.out.println(Math.min(12.323,23.232)); //12.232