1、public static double abs(double num):获取绝对值,有多种重载
2、public static double ceil(double num):向上取整
3、public static double floor(double num):向下取整
4、public static long round(double num):四舍五入
Math.PI ---近似圆周率
public class DemoMath {
public static void main(String[] args) {
System.out.println(Math.abs(1.1));
System.out.println(Math.abs(-1.1));
System.out.println("======== 1 ========");
System.out.println(Math.ceil(1.1));
System.out.println(Math.ceil(1.8));
System.out.println(Math.ceil(-1.1));
System.out.println(Math.ceil(-1.8));
System.out.println("======== 2 ========");
System.out.println(Math.floor(1.1));
System.out.println(Math.floor(1.8));
System.out.println(Math.fl