Home >>PHP Math Functions >PHP expm1() Function
PHP expm1() function is used to calculate e raised to the power of the given input argument minus one (ex-1). It takes a single parameter $power which is the power e has to be raised to. It returns a floating point value as output which is the value of e raised to the power of the given $power argument -1.
Syntax:
expm1($power);
Parameter | Description |
---|---|
power | This is a required parameter. This parameter defines the given exponent value. |
Here is an example of expm1() function in PHP:
<html> <body> <?php echo "Value of (e1) : ".exp(1)."<br>"; echo "Value of (e1-1) : ".expm1(1)."<br>"; echo "Value of (e2) : ".exp(2)."<br>"; echo "Value of (e2-1) : ".expm1(2)."<br>"; ?> </body> </html>
Here is an another example of expm1() function in PHP:
<html> <body> <?php echo expm1(0)."<br>"; echo expm1(1)."<br>"; echo expm1(5)."<br>"; echo expm1(8.5)."<br>"; echo expm1(21)."<br>"; echo expm1(25.5)."<br>"; ?> </body> </html>