How to use exp1() to get the base-e exponential raised to the power of argument x in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
        
        System.out.println("Math.expm1(-1) = " + Math.expm1(-1));
        System.out.println("Math.expm1(1) = " + Math.expm1(1));
        System.out.println("Math.expm1(0) = " + Math.expm1(0));
        System.out.println("Math.expm1(-0) = " + Math.expm1(-0));
        System.out.println("Math.expm1(100) = " + Math.expm1(100));
        System.out.println("Math.expm1(710) = " + Math.expm1(710));
        System.out.println("Math.expm1(Infinity) = " + Math.expm1(Double.POSITIVE_INFINITY));
        System.out.println("Math.expm1(-Infinity) = " + Math.expm1(Double.NEGATIVE_INFINITY));
    }
}
 
/*
run:

Math.expm1(-1) = -0.6321205588285577
Math.expm1(1) = 1.718281828459045
Math.expm1(0) = 0.0
Math.expm1(-0) = 0.0
Math.expm1(100) = 2.6881171418161356E43
Math.expm1(710) = Infinity
Math.expm1(Infinity) = Infinity
Math.expm1(-Infinity) = -1.0
 
*/

 



answered Sep 9, 2016 by avibootz
...