java.lang.Math

System.out.println(Math.PI);

System.out.println(Math.abs(1.2));

System.out.println(Math.abs(1.2));

System.out.println(Math.abs(1));

System.out.println(Math.abs(111111111));

System.out.println(Math.cos(45));

//立方根

System.out.println("cbrt: "+Math.cbrt(27));

//>=参数的最小整数

System.out.println("ceil:"+Math.ceil(3.1));

//<=参数的最大整数>

System.out.println("floor:"+Math.floor(3.1));

//(参数1的平方+参数2的平方)的平方根

System.out.println("hypot:"+Math.hypot(1,1));

//参数平方根

System.out.println("sqrt:"+Math.sqrt(2));

//10的几次方等于参数

System.out.println("log10:" + Math.log10(100));

//求2个参数中最大的那个

System.out.println("max :"+Math.max(10, 20));

//求2个参数中最小的那个

System.out.println("min:"+Math.min(10, 20));

//

System.out.println("nextAfter:"+Math.nextAfter(1, 2));

//弧度->角度(角度=弧度*180/pi)

System.out.println("toDegress:"+Math.toDegrees(100));

//角度->弧度(弧度=角度*pi、180)

System.out.println("toRadians"+Math.toRadians(5729.5779513082325));

你可能感兴趣的:(java,Math,lang)