In mathematics, the exponential function is the function `e`

, where ^{x}`e`

is the number (approximately 2.718281828) such that the function `e`

equals its own derivative. The function ^{x}`f(x) = e`

at the point ^{x}`x = 0`

is equal to `1`

.

package org.kodejava.example.math; public class ExponentExample { public static void main(String[] args) { double x = 0.0d; // // calculates e raised to the power of x (e^x) // double fx = Math.exp(x); // // calculates e raised to the power of x minus 1 (e^x - 1) // double fxm1 = Math.expm1(x); System.out.println("fx = " + fx); System.out.println("fxm1= " + fxm1); } }

### Wayan Saryada

A programmer, runner, recreational diver, currently living in the island of Bali, Indonesia. Mostly programming in Java, creating web based application with Spring Framework, Hibernate / JPA.

#### Latest posts by Wayan Saryada (see all)

- How do I do multipart upload using HttpClient? - January 11, 2017
- How do I convert number into Roman Numerals? - January 8, 2017
- How do I send POST request with a JSON body using the HttpClient? - January 7, 2017

thank you so much. really helped