JS Built-ins
← Math113 / 215
Mathexpm1intermediate

Math.expm1(-1) β‰ˆ -0.632

πŸ“– Usage Example
// e^x minus 1, precise for very small x
Math.expm1(0)     // β†’ 0
Math.expm1(0.001) // β†’ 0.0010005...

Use Math.expm1(x) instead of Math.exp(x) - 1 for small x values to avoid floating-point precision loss.

Math.expm1(x)

Math.expm1(-1) returns approximately -0.6321 (= 1/e - 1).

Challenge: Compute and verify Math.expm1(-1).

πŸ’‘ Hints (2)
  • β€’ expm1(-1) = e⁻¹ - 1 = 1/e - 1 β‰ˆ -0.632
  • β€’ Negative inputs produce results in the range (-1, 0)