Javatpoint Logo
Javatpoint Logo

Java Math.cosh() method

The java.lang.Math.cosh() is used to return the hyperbolic cosine of a value. The hyperbolic cosine of any value x can be defined as (ex + e -x)/2, where e is an Euler's number.

Syntax

Parameter

Return

  • If the argument is positive or negative number, this method will return hyperbolic cosine value.
  • If the argument is Zero, this method will return 1.0.
  • If the argument is Infinity, this method will return Positive Infinity.
  • If the argument is NaN, this method will return NaN.

Example 1

Test it Now

Output:

5.710036949078421E25

Example 2

Test it Now

Output:

1.0

Example 3

Test it Now

Output:

Infinity

Example 4

Test it Now

Output:

NaN

Next TopicJava Math




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA