JavaScript Math acosh()

The JavaScript Math.acosh() function returns the hyperbolic arc-cosine of a number.

acosh() performs the inverse operation of the Math.cosh function.

The syntax of the Math.acosh() function is:

Math.acosh(x)

acosh(), being a static method, is called using the Math class name.


Math.acosh() Parameters

The Math.acosh() function takes in:

  • x - A number

Return value from Math.acosh()

  • Returns the hyperbolic arc-cosine of the given number.
  • Returns NaN if number < 1.

Example: Using Math.acosh()

// Using Math.acosh()

var num = Math.acosh(0);
console.log(num); // NaN

var num = Math.acosh(1);
console.log(num); // 0

var num = Math.acosh(-1);
console.log(num); // NaN

var num = Math.acosh(2);
console.log(num); // 1.3169578969248166

Output

NaN
0
NaN
1.3169578969248166

Recommended readings: