PHP log10() Function – Base‑10 Logarithm

The PHP log10() function returns the base‑10 logarithm of a floating‑point argument, detailing its signature, parameter description, return value, and providing example code with expected output for various inputs.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
PHP log10() Function – Base‑10 Logarithm

The log10() function in PHP returns the base‑10 logarithm of a given floating‑point argument.

Signature: float log10(float $arg) Parameter: $arg – the number to calculate the logarithm for.

Return value: The base‑10 logarithm of $arg as a float.

Example:

<?php
echo log10(2.7183);
echo log10(2);
echo log10(1);
echo log10(0);
echo log10(-1);
?>

Output:

0.434297385125
0.301029995664
0
-INF
#IND
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendPHPfunctionmathematicsexamplelog10
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.