Java中的Math類的常用方法
1.三角函數(shù)
public static double sin(double a);
public static double cos(doublc a);
public static double tan(double a);
public static double asin(double a);
public static double acos(double a);
public static double atan(double a);
2.指數(shù)函數(shù)
public static double exp(double a):ea
public static double log(double a):ln(a)
public static double pow(double x,
double y): yx
public static double sqrt(double a):
3.舍入函數(shù)
public static int ceil(double a):返回大于或等于a的最小整數(shù)
public static int floor(double a):返回小于或等于a的最大整數(shù)。
public static int abs(int a)
public static int max(int a,int b)
public static int min(int a,int b)
4.其它方法
public static double random():返回0至1之間的一個“隨機數(shù)”。
public static double toRadians(double angle):將角度轉換為弧度
public static double toDegrees(double angle):將弧度轉換為角度。
點擊加載更多評論>>