The cosh() method of Math class returns the first hyperbolic cosine((e+e)/2) of a double value.


public static double cosh(double x)


The parameter ‘x’ represents the number whose hyperbolic cosine is to be determined.

Return Value:

The cosh() method returns the hyperbolic cosine of x.

Special cases of the cosh() method are as follows:

  • It returns NaN, is the argument passed is NaN.
  • It returns positive infinity, if the argument passed is infinite.
  • It returns 1.0, if the argument passed is zero.

Example 1:


Example 2:


Example 3:


Example 4:


Pin It on Pinterest

Share This