package zhiZuo4;

import java.util.Random;

public class Math {

    public static void main(String[] args)
    {
        //数学运算 四舍五入
        System.out.println(java.lang.Math.round(16.487));
        //取上限值
        System.out.println(java.lang.Math.ceil(16.487));
        //取下限值
        System.out.println(java.lang.Math.floor(16.487));
        //π
        System.out.println(java.lang.Math.PI);
        //随机数
        System.out.println(java.lang.Math.random());
        System.out.println(java.lang.Math.random());
        System.out.println(java.lang.Math.random());
        Random R = new Random();
        R.nextInt(100);
        System.out.println(R.nextInt(1000));
        System.out.println(R.nextInt(1000));
        System.out.println(R.nextInt(100));
    } 

}

 

posted on 2015-12-17 08:25  halooomo  阅读(93)  评论(0编辑  收藏  举报