/*
* Math 数学类,提供各种数学计算方法
*
* 1. abs(double value) 获取绝对值
* 2. ceil(double value) 向上取整
* 3. floor(double value) 向下取整
* 4. random() 生成随机数,大于0.0 到1.0之间的随机数
* 5. round(double value) 四舍五入
*/
public class Demo14 {
public static void main(String[] args) {
// TODO Auto-generated method stub
double i = -10.3;
System.out.println(Math.abs(i));
System.out.println(Math.ceil(i));
System.out.println(Math.floor(i));
System.out.println(Math.round(i));
System.out.println(Math.random());
}
}