The Math.acosh() function in Javascript is used to return the hyperbolic arc-cosine of a number.
Math.acosh (x) = arcosh(x) = y ≧ 0 such that cosh (y)=x
acosh() is a static method of Math, therefore it is always used as Math.acosh(), rather than as a method of a Math object created.
Syntax:
Math.acosh(value)
Parameters Used:
1. value:It is the number whose hyperbolic arc-cosine you want to know.
Return Value:
It returns the hyperbolic arc-cosine of the given number and if the parameter passed is less than 1, it returns NaN.
Examples:
Input : Math.acosh(1) Output : 0 Input :Math.acosh(0) Output :NaN Input :Math.acosh(-1) Output :NaN Input :Math.acosh(2) Output : 1.3169578969248166
- When 1 is passed as a parameter.
<
script
type
=
"text/javascript"
>
document.write("OUTPUT : " + Math.acosh(1));
</
script
>
OUTPUT:
OUTPUT : 0
- When 0 is passed as a parameter.
<
script
type
=
"text/javascript"
>
document.write("OUTPUT : " + Math.acosh(0));
</
script
>
OUTPUT:
OUTPUT : NaN
- When a number less than 0 is passed as a parameter.
<
script
type
=
"text/javascript"
>
document.write("OUTPUT : " + Math.acosh(-1));
</
script
>
OUTPUT:
OUTPUT : NaN
- When 2 is passed as a parameter.
<
script
type
=
"text/javascript"
>
document.write("OUTPUT : " + Math.acosh(2));
</
script
>
OUTPUT:
OUTPUT : 1.3169578969248166
This article is attributed to GeeksforGeeks.org
0 0You Might Also Like
Subscribe to Our Newsletter
- When 0 is passed as a parameter.
leave a comment
0 Comments