3:20 am - Friday April 19, 2019

Math Example Program for expm1(double x)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
//Math Example Program for expm1(double x)
/**
 * @author:Candidjava.com
 * @description:calculate the expm1 of a double value
 */
import java.lang.*;
public class ExponentExample {
	public static void main(String[] args) {
		double x = 5.0d;
		double d = Math.exp(x); // calculates e raised to the power of x (e^x)
		double d1 = Math.expm1(x);// calculates e raised to the power of
		// x minus 1 (e^x -1)
		System.out.println("d = " + d);
		System.out.println("d1= " + d1);
	}
}

Output:
d = 148.4131591025766
d1= 147.4131591025766

Filed in: Z-A All Java Codes

Comments are closed.