StrictMath.exp() in Java

StrictMath.exp(): This method is available in java.lang.StrictMath class of Java.

Syntax:

double java.lang.StrictMath.exp(double a)

This method takes one argument of type double as its parameter. This method returns Euler's number e raised to the power of a double value.

Special cases:

1. f the argument is NaN, the result is NaN.

2. If the argument is positive infinity, then the result is positive infinity.

3. If the argument is negative infinity, then the result is positive zero.

Parameters: One parameter is required for this method.

a: the exponent to raise e to.

Returns: the value e^a,where e is the base of the natural logarithms.

Exceptions: NA

Approach

Java

public class StrictMathexp {
    public static void main(String[] args) {

        double a = 22;
        System.out.println(StrictMath.exp(a));
    }
}

Output:

3.584912846131592E9


No comments:

Post a Comment