PHP - log1p
Trieda
Metóda - log1p
(PHP 4 >= 4.1.0, PHP 5, PHP 7)
The log1p() function returns the logarithm of a value 1 + x,
i.e. log(1 + x). For x close to 0, this function is more
accurate than calling the log(1 + x) function.
Procedurálne
- function log1p (float $number) : float
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $number | float | A number. |
Mávratovej hodnoty
Vracia: float
The resulting logarithm.
Príklady
<?php
for ($i = 0; $i < 10; $i++) {
$x = rand(1, 20);
echo ("log1p($x)= " . log1p($x) . "<br />");
}
