System.out.println(Math.ceil(3.2)); //返回大于或等于給定數(shù)的整數(shù)
System.out.println(Math.floor(3.8)); //返回小于或等于給定數(shù)的整數(shù)
System.out.println(Math.round(3.5)); //四舍五入
System.out.println(Math.abs(-45)); //絕對值
System.out.println(Math.sqrt(64)); //算術(shù)平方根
System.out.println(Math.pow(5,2)); //返回5的2次方
System.out.println(Math.PI);
System.out.println(Math.E);
System.out.println(Math.random()); //返回0到1之間的隨機數(shù)