The java.lang.StrictMath.cosh() is an inbuilt method in Java which returns the hyperbolic cosine value of a given double argument.
- The method returns NaN when the argument is NaN.
- The method returns a positive infinity when the argument is infinity.
- The method returns 1.0 when the given argument is 0.0.
public static double cosh(double num)
Parameters: The method accepts one parameter num of double type whose hyperbolic cosine value is to be returned.
Return Value : The method returns the hyperbolic cosine value of num.
Input: num = 60.0 Output: 5.710036949078421E25 Input: num = 0.0 Output: 1.0
Below programs illustrate the java.lang.StrictMath.cosh() method:
The cosh of 78.8 = 8.344016962852523E33 The cosh of 0.0 = 1.0 The cosh of 1.0 = 1.543080634815244
The cosh of 0.5235987755982988 = 1.1402383210764286 The cosh of 11.0 = 29937.070865949758 The cosh of 45.0 = 1.7467135528742547E19
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.