Math类的使用。

目标:Math类的使用。

  Math用于做数学运算。

  Math类中的方法全都是静态方法,直接用类名调用即可。

  方法:

    方法体:              说明

    public static int abs(int a);            获取参数a的绝对值

    public static double ceil(double a)      向上取整

    public static double floor(double a)    向下取整

    public static double pow(double a,double b)  获取a的b次幂

    public static long round(double a)      四舍五入取整

原文地址:https://www.cnblogs.com/bichen-01/p/14317516.html