Math

来源:互联网 发布:淘宝卖家钻石 编辑:程序博客网 时间:2024/06/05 07:24


public class TestMath {


public static void main(String[]args){
System.out.println("计算-10.4的绝对值"+Math.abs(-10.4));
System.out.println("比较55和-10哪个数小"+Math.min(55,-10));
System.out.println("比较0.0和-0.0哪个数大"+Math.max(0.0,-0.0));
System.out.println("取0-1之间的随机数"+Math.random());


}


}
0 0