JS Built-ins
← Math53 / 215
Mathacoshintermediate

Math.acosh() Out of Domain Returns NaN

πŸ“– Usage Example
// Inverse hyperbolic cosine (input must be β‰₯ 1)
Math.acosh(1)   // β†’ 0
Math.acosh(2)   // β†’ 1.3169...

Use Math.acosh() to compute the inverse hyperbolic cosine of a number β‰₯ 1.

Math.acosh(x)

Math.acosh() is only defined for x β‰₯ 1. Values below 1 return NaN.

Challenge: Verify that Math.acosh(0) returns NaN.

πŸ’‘ Hints (2)
  • β€’ The domain of acosh is [1, ∞)
  • β€’ Values less than 1 produce NaN