java tutorial - Java Math.exp() Method - tutorial java - java programming - learn java - java basics - java for beginners



Java numbers exp

Learn Java - Java tutorial - Java numbers exp - Java examples - Java programs

Description

Method Math.exp () - returns the natural logarithm for the base e and the argument for the exponent, where e is an irrational constant equal to approximately 2.718281828

Syntax

double exp(double d)
click below button to copy the code. By - java tutorial - team

Options

Detailed information about the parameters:

  • d is any primitive data type.

Return value

  • In Java, Math.exp () returns the natural logarithm of the base e and the argument, the exponent.

Sample Code

public class Test { 

   public static void main(String args[]) {
      double x = 11.635;

      System.out.printf("The value of h = %.3f%n", Math.E);
      System.out.printf("exp(%.3f) = %.3f%n", x, Math.exp(x));  
   }
}
click below button to copy the code. By - java tutorial - team

Output

The value of h = 2,718
exp(11,635) = 112983,831

Related Searches to Java Math.exp() Method