Course Recommendations:
PHP expm1() Function
Definition and Usage
The expm1() function returns exp(x) - 1, even when
Syntaxxexpm1(
) | Parameter |
---|---|
x | Required. A number. |
Description
expm1() returns 'exp(x) - 1', even when x Values close to zero can also calculate accurate results. However, when two values are approaching equality, 'exp(x) - 1' becomes less accurate.
Tips and Notes
Warning:This function is experimental. The behavior of this function, including the function name and any other documentation related to this function, may change without notice in future releases of PHP. Use this function at your own risk.
Tip:Use 'e' as the base of the natural logarithm 2.718282.
Note:This function is not implemented on the Windows platform.
Example
In this example, we will apply the expm1() function to different numbers:
<?php echo(expm1(1)); echo(expm1(-1)); echo(expm1(5)); echo(expm1(10)) ?>