/*
* Math 數(shù)學(xué)類钩骇,提供各種數(shù)學(xué)計算方法
*
* 1. abs(double value) 獲取絕對值
* 2. ceil(double value) 向上取整
* 3. floor(double value) 向下取整
* 4. random() 生成隨機數(shù),大于0.0 到1.0之間的隨機數(shù)
* 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());
}
}