MathDemo修改版

public class  
{
	public static void main(String args[])
	{
		System.out.println("abs(-5)="+Math.abs(-5));
		System.out.println("max(6.75,3.14)="+Math.max(6.75,3.14));
		System.out.println("main(100,200)="+Math.min(100,200));
		System.out.println("round(3.5)="+Math.round(3.5));
		System.out.println("(-6.5)="+Math.round(-6.5));
		System.out.println("sqrt(2)="+Math.sqrt(2));
		System.out.println("pow(2,5)="+Math.pow(2,5));
		System.out.println("E="+Math.E);
		System.out.println("exp(2)="+Math.exp(2));
		System.out.println("log(2)="+Math.log(2));
		System.out.println("ceil(6.75)="+(int)Math.ceil(6.75));
		System.out.println("floor(6.75)="+(int)Math.floor(6.75));
		System.out.println("Pi="+Math.PI);
		System.out.println("sin(Pi/4)="+Math.sin(Math.PI/4));
		System.out.println("cos(1)="+Math.cos(1));
	}

}
 
 MathDemo修改版_第1张图片 
 

你可能感兴趣的:(MathDemo修改版)