PHP expm1() Function

Definition and Usage

The expm1() function returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero, a case where 'exp (number) - 1' would be inaccurate due to subtraction of two numbers that are nearly equal.

expm1(x) = exp(x) - 1

This function returns a float value .

Syntax

expm1 ( float $arg ) : float

Parameters

Sr.No Parameter & Description
1 arg
A floating point number whose expm1 is to be calculated.

Return Values

PHP expm1() function returns a floating point value.

PHP Version

This function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.

Example

<?php
   echo "expm1(1) = " . expm1(1) . "
"; ?>

Output

This will produce following result −

expm1(1) = 1.718281828459
Updated on: 2026-03-11T23:22:53+05:30

132 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements