Math.exp()
Math.exp() returns e raised to the power x ( input number ) .
Syntax
Math.exp(input_number)
Here are some examples with different type of numbers.
System.out.println(Math.exp(4)); //54.598150033144236
System.out.println(Math.exp(1)); //2.718281828459045
System.out.println(Math.exp(0)); //1.0
System.out.println(Math.exp(4.12)); //61.55924226442852
Using negative input numbers
System.out.println(Math.exp(-4.12)); //0.01624451444194987
System.out.println(Math.exp(-1)); //0.36787944117144233
Using formula and e
The math formula for exp() function is e ** x
e : is a numerical constant of value equal to 2.71828
This is the base of natural logarithm and known as Euler's number.
« All Math functions
This article is written by plus2net.com team.
plus2net.com