Home >>Java Math Methods >Java Math.exp() method
The Math.exp() in Java Math is used to return the number e of the Euler raised to a double-value power. Here, e is the number of an Euler and is roughly equal to 2.718281828459045.
public static double exp(double x)
x = This parameter is used to the exponent which raise to e
It is used to returns the value ex, where e is the base of the natural logarithms.
public class MyClass
{
public static void main(String[] args)
{
double x = 4.0;
System.out.println(Math.exp(x));
}
}
public class MyClass
{
public static void main(String[] args)
{
double x = -5.0;
System.out.println(Math.exp(x));
}
}