bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math log1p() Method

❮ Math Methods

Example

System.out.println(Math.log1p(6));
System.out.println(Math.log1p(Math.E));
System.out.println(Math.log1p(2));
System.out.println(Math.log1p(1));
System.out.println(Math.log1p(0));
System.out.println(Math.log1p(-1));

Definition and Usage

The log1p() method returns the natural logarithm of 1 + x for any number x.

The natural logarithm is the logarithm with base e . The value of e is approximately 2.718282 and it is available as the constant Math.E in Java.

Syntax

public static double log1p(double
number )

Parameter Values

ParameterDescription
numberRequired. A value greater than or equal to -1. If the value is less than -1 the method returns NaN (Not a Number).

Technical Details

Returns:A double value representing the natural logarithm of 1 + x for a number x.
Java version:1.5+

Previous

Java Math log10() Method

Next

Java Math max() Method