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



Java numbers log

Learn Java - Java tutorial - Java numbers log - Java examples - Java programs

Description

The Math.log () method - returns the natural logarithm of the argument.

Syntax

double log(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.log () returns the natural logarithm of the argument.

Sample Code

public class Test { 

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

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

Output

The value of e = 2,718
log(11,635) = 2,454

Related Searches to Java Math.log() Method