Math.expm1
Math.expm1
Function
Natural exponent minus one. Return exp(value) - 1.
Syntax
Math.expm1(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Number | Yes | None | Exponent. |
Return value
| Type | Description |
|---|---|
| Int/Float | Returns exp(value) - 1. An Int is returned for integer results, and a Float for non-integer or non-finite results. |
Example
result = Math.expm1(1) // Output: 1.718281828459045 print result
Notes
- Better for maintaining f64 accuracy when using decimal input than manual subtraction.