算术函数运算

public class MFUN {
	public static void main(String[]args)
	{
		float a=3,b=4;
		System.out.println("exp(a)="+Math.exp(a));
		System.out.println("log(a)="+Math.log(a));
		System.out.println("sqr(a)="+Math.sqrt(a));
		System.out.println("abs(-a*b)="+Math.abs(-a*b));
		System.out.println("3*3*3*3="+Math.pow(a,b));
		System.out.println("max(a,b)="+Math.max(a,b));//取a,b的较大者
	
	}

}


结果:

exp(a)=20.085536923187668
log(a)=1.0986122886681098
sqr(a)=1.7320508075688772
abs(-a*b)=12.0
3*3*3*3=81.0
max(a,b)=4.0


 

你可能感兴趣的:(算术函数运算)