Java Math cosh() Method
Example
Return the hyperbolic cosine of different numbers:
System.out.println(Math.cosh(3));
System.out.println(Math.cosh(-3));
System.out.println(Math.cosh(0));
System.out.println(Math.cosh(1));
Definition and Usage
The cosh() method returns the hyperbolic cosine of a number.
The hyperbolic cosine is equivalent to (Math.exp(number) + Math.exp(-number)) / 2.
Syntax
public static double cosh(double number)
Parameter Values
| Parameter | Description |
|---|---|
| number | Required. A number to find the hyperbolic cosine of. |
Technical Details
| Returns: | A double value representing the hyperbolic cosine of a number. |
|---|---|
| Java version: | 1.5+ |
❮ Math Methods