Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

log10()

Example

Provide the base 10 logarithm for various numbers.

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 function log10() calculates the logarithm of a number with base 10.

Syntax

public static double log10(double number)

Parameter Values

Parameter

Description

number

The “Required” parameter indicates the value for which the logarithm is to be calculated. If this value is negative, the function returns NaN (Not a Number). If the value is 0, it returns -Infinity.

Technical Details

Returns

It returns a double value representing the logarithm of the number with base 10.

Java Version

1.5+