1.Math.ceil()

System.out.println(Math.ceil(3.4));
//输出4
System.out.println(Math.ceil(3.7));
//输出4
System.out.println(Math.ceil(-3.4));
//输出-3
System.out.println(Math.ceil(-3.7));
//输出-3

2.Math.floor()

System.out.println(Math.floor(3.4));
//输出3
System.out.println(Math.floor(3.7));
//输出3
System.out.println(Math.floor(-3.4));
//输出-4
System.out.println(Math.floor(-3.7));
//输出-4

3.Math.round() 

记忆法则:将原有的数加上0.5之后再向下取整

System.out.println(Math.round(3.4));
//输出3
System.out.println(Math.round(3.7));
//输出4
System.out.println(Math.round(-3.4));
//输出-3
System.out.println(Math.floor(-3.7));
//输出-4
System.out.println(Math.floor(-3.5));
//输出-3

4.补充:int() 

System.out.println(Math.int(3.4));
//输出3
System.out.println(Math.int(3.7));
//输出3
System.out.println(Math.int(-3.4));
//输出-3
System.out.println(Math.int(-3.7));
//输出-3