PHP expm1

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PHP : expm1() function

Description

The expm1() function is used to calculate the equivalent of exp(x)-1. 'e' is the base of the natural system of logarithms (approximately 2.718282).

Version

(PHP 4 and above)

Syntax

expm1(x)

Parameter

Name

Description

Required /
Optional

Type

x

A number.

Required

Float

Return value

'e' to the power of x minus one.

Value Type : Float.

Example :

  1. $val2=1;  

  2. $val3=2;  

  3. $val4=10;  

  4. $zexp2=expm1($val2);  

  5. $zexp3=expm1($val3);  

  6. $zexp4=expm1($val4);  

  7. echo "expm1 of $val2 is $zexp2
    ";  

  8. echo "expm1 of $val3 is $zexp3
    ";  

  9. echo "expm1 of $val4 is $zexp4
    ";  

  10. ?>  

Output :