PHP log10() Function

In this chapter you will learn:

  1. Definition for PHP log10() Function
  2. Syntax for PHP log10() Function
  3. Parameter for PHP log10() Function
  4. Return for PHP log10() Function
  5. Example - Return the base-10 logarithm of different numbers

Definition

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

Syntax

PHP log10() Function has the following syntax.

log10(number);

Parameter

ParameterIs Required Description
numberRequired.Value to calculate the logarithm for

Return

Item Description
Return Value The base-10 logarithm of number
Return Type Float

Example

Return the base-10 logarithm of different numbers:


<?php//jav a 2s.com
echo(log10(2.7183) . "\n");
echo(log10(2) . "\n");
echo(log10(10) . "\n");
echo(log10(0));
?>

The code above generates the following result.

Next chapter...

What you will learn in the next chapter:

  1. Definition for PHP log1p() Function
  2. Syntax for PHP log1p() Function
  3. Parameter for PHP log1p() Function
  4. Return for PHP log1p() Function
  5. Example - Return log(1+number) for different numbers