PHP log10() Function
In this chapter you will learn:
- Definition for PHP log10() Function
- Syntax for PHP log10() Function
- Parameter for PHP log10() Function
- Return for PHP log10() Function
- 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
Parameter | Is Required | Description |
---|---|---|
number | Required. | 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:
- Definition for PHP log1p() Function
- Syntax for PHP log1p() Function
- Parameter for PHP log1p() Function
- Return for PHP log1p() Function
- Example - Return log(1+number) for different numbers
Home » PHP Tutorial » PHP Math Functions