Math类
2019-03-24 / JAVA / 833 次围观 / 0 次吐槽 /Math的方法列举
1.public static int abs(int a) 取绝对值
2.public static double ceil(double a) //向上(往大数)取整
3.public static double floor(double a) // 向下(往小数)取整
4.public static int max(int a,int b) 取最大值, min方法自学
5.public static double pow(double a,double b) a^b a的b次方
6.public static double random() 生成0~0.99999的随机数
7.public static int round(float a) 四舍五入取整数。
8.public static double sqrt(double a) 值的正平方根
Powered By Cheug's Blog
Copyright Cheug Rights Reserved.