The expm1()
method from the java.lang.Math
class can be used to calculate the exponential function . It takes the value as argument and returns the result of .
static double expm1(double x)
The expm1()
method takes the following input parameter.
x
: A double
type argument value that represents the power of in the expression .The method returns a primitive double
type value which is the result of the expression.
The result is NaN
if the argument value is NaN.
The result is -1.0
if the argument is negative infinity.
The result is positive infinity
if the argument value is positive infinity.
Case 1: Positive number as an argument.
Case 2: Negative number as an argument.
Case 3: Zero as an argument value.
Case 4: Positive infinity as an argument.
Case 5: Negative infinity as an argument.
Execute the code below to see the output.
// Load libraryimport java.lang.Math;// Main classclass EdPresso {public static void main( String args[] ) {System.out.println(Math.expm1(6));}}
RELATED TAGS
CONTRIBUTOR