PHP - exp
Trieda
Metóda - exp
(PHP 4, PHP 5, PHP 7)
This function returns the base of natural logarithm - Euler's number raised to the power of a given argument (e^x).
It is equivalent to pow(M_E, x).
Procedurálne
- function exp (float $arg) : float
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $arg | float | The Euler's number exponent. |
Mávratovej hodnoty
Vracia: float
The raised Euler's number returned as a float.
Príklady
<?php
for ($i = 0; $i <= 10; $i++)
echo ("exp $i = " . exp($i) . "<br>");
This example outputs (if viewed from a web browser):
exp 0 = 1 exp 1 = 2.718281828459 exp 2 = 7.3890560989307 exp 3 = 20.085536923188 exp 4 = 54.598150033144 exp 5 = 148.41315910258 exp 6 = 403.42879349274 exp 7 = 1096.6331584285 exp 8 = 2980.9579870417 exp 9 = 8103.0839275754 exp 10 = 22026.465794807
