bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math log10() Method

❮ Math Methods

Example

System.out.println(Math.log10(120));
System.out.println(Math.log10(10));
System.out.println(Math.log10(3.1623));
System.out.println(Math.log10(1));
System.out.println(Math.log10(0));
System.out.println(Math.log10(-1));

Definition and Usage

The log10() method returns the base 10 logarithm of a number.

Syntax

public static double log10(double
number )

Parameter Values

ParameterDescription
numberRequired. Specifies the value to calculate the logarithm for. If the value is negative, it returns NaN (Not a Number). If the value is 0, it returns -Infinity.

Technical Details

Returns:A double value representing the base 10 logarithm of a number.
Java version:1.5+

Previous

Java Math log() Method

Next

Java Math log1p() Method