expm1 (Function)

Signature: expm1(x: float) -> float

Description: Computes e^x - 1 directly, avoiding loss of small results when subtracting 1 from exp(x). Large positive inputs yield infinity.

Parameters

  • x (float): The exponent

Returns: float

Example

print(expm1(0.1))  // 0.10517091807564763
print (expm1 0.1)  // 0.10517091807564763