How to Get the Exponential Value minus One of the Given Number in Java


Here we will learn how to get the exponential value minus one of the given number with Math.expm1().

Source Code

package com.beginner.examples;

public class Expm1Example {

    public static void main(String[] args){
    	//return the exponential value minus one of the given number.
    	double a = -10.8;
    	double b = 0;
    	double c = 2.01;
    	System.out.println("(Exponential value-1) of " + a + " is: " + Math.expm1(a));
        System.out.println("(Exponential value-1) of " + b + " is: " + Math.expm1(b));
        System.out.println("(Exponential value-1) of " + c + " is: " + Math.expm1(c));
    }
}

Output:

(Exponential value-1) of -10.8 is: -0.9999796004965888
(Exponential value-1) 0.0 is: 0.0
(Exponential value-1) of 2.01 is: 6.463317347319193
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments