log10() function in PHP


The log10() function Return the base-10 logarithm of a number.

Syntax

log10(num)

Parameters

  • num − The value to calculate the logarithm for.

Return

The log10() function Returns base 10 logarithm of a number.

Example

 Live Demo

<?php
   echo(log10(1));
?>

Output

0

Example

Let us see another example −

 Live Demo

<?php
   echo(log10(0));
?>

Output

-INF

Example

Let us see another example −

 Live Demo

<?php
   echo(log10(10));
   echo(log10(2.7));
?>

Output

10.43136376415899

Updated on: 27-Dec-2019

47 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements