Facebook Page Twitter Page LinkedIn Page
× PHP Tutorial PHP Advanced PHP Resources


The PHP Math expm1() function returns e raised to the power of specified number minus 1, i.e., ex-1. Please note that e is the base of the natural system of logarithms, and its value is approximately 2.718282.

Syntax

expm1(x)   

Parameters

x Required. Specify the exponent of e.

Return Value

Returns e raised to the power of specified number minus 1, i.e., ex-1.

Example:

In the example below, expm1() function is used to calculate e raised to the power of specified number minus one.

<?php
echo expm1(2)."\n";
echo expm1(-2)."\n";
echo expm1(1.5)."\n";
echo expm1(-1.5)."\n";
?>

The output of the above code will be:

6.3890560989307
-0.86466471676339
3.4816890703381
-0.77686983985157

❮ PHP Math Functions

5