Home >>PHP Math Functions >PHP exp() Function
PHP exp() function is used to calculate e raised to the power of the given input power (ex). Here 'e' is the base of the natural system whose value is approximately 2.718282. It takes only a single parameter $power which defines the power e has to be raised to. It returns the value of e raised to the power of the given input argument.
Syntax:
exp($power);
Parameter | Description |
---|---|
power | This is a required parameter. This parameter defines the exponent. |
Here is an example of exp() functionin PHP:
<html> <body> <?php echo exp(0)."<br>"; echo exp(1)."<br>"; ?> </body> </html>
Here is an another example of exp() functionin PHP:
<html> <body> <?php echo exp(2)."<br>"; echo exp(5)."<br>"; echo exp(15)."<br>"; echo exp(6.3)."<br>"; echo exp(20)."<br>"; ?> </body> </html>