Java数字工具类java.lang.Math的几个常用函数。 12345678910111213141516package MathTest;public class MathTest { public static void main(String[] args) { System.out.println(Math.abs(-5)); //绝对值 System.out.println(Math.max(-5,-8)); //最大值 System.out.println(Math.min(-5,-8)); //最小值 System.out.println(Math.pow(-5,2)); //求幂 System.out.println(Math.round(3.5)); //四舍五入 System.out.println(Math.ceil(3.5)); //向上取整 System.out.println(Math.floor(3.5)); //向下取整 }} 12345675-5-825.044.03.0