Math.acosh()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Phương thức tĩnh Math.acosh() trả về arccos hyperbolic của một số. Cụ thể:
Try it
console.log(Math.acosh(0.999999999999));
// Expected output: NaN
console.log(Math.acosh(1));
// Expected output: 0
console.log(Math.acosh(2));
// Expected output: 1.3169578969248166
console.log(Math.acosh(2.5));
// Expected output: 1.566799236972411
Cú pháp
js
Math.acosh(x)
Tham số
x-
Một số lớn hơn hoặc bằng 1.
Giá trị trả về
Arccos hyperbolic của x. Nếu x nhỏ hơn 1, trả về NaN.
Mô tả
Vì acosh() là một phương thức tĩnh của Math, bạn luôn sử dụng nó dưới dạng Math.acosh(), thay vì là phương thức của một đối tượng Math bạn tạo ra (Math không phải là constructor).
Ví dụ
>Sử dụng Math.acosh()
js
Math.acosh(0); // NaN
Math.acosh(1); // 0
Math.acosh(2); // 1.3169578969248166
Math.acosh(Infinity); // Infinity
Đặc tả kỹ thuật
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-math.acosh> |