w3resource

PHP: log10() function

Description

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

Version:

(PHP 4 and above)

Syntax:

log10(num)

Parameter:

Name Description Required /
Optional
Type
num The argument to process. Required Float

Return value

The base-10 logarithm of num.

Value Type: Float.

Example:

<?php
echo(log10(2) . "<br />");
echo(log10(1.234) . "<br />");
echo(log10(0) . "<br />");
echo(log10(1) . "<br />");
?>

Output:

0.301029995664
0.0913151596972
-INF
0

View the example in the browser

See also

PHP Function Reference

Previous: lcg_value
Next: log1p



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/php/function-reference/log10.php