Java Data Type Tutorial - Java StrictMath.cosh(double x)








Syntax

StrictMath.cosh(double x) has the following syntax.

public static double cosh(double x)

Example

In the following code shows how to use StrictMath.cosh(double x) method.

//www.jav  a 2s  .c  o  m
public class Main {

  public static void main(String[] args) {
  
    double d1 = (60*(Math.PI))/180 , d2 = 0.0, d3 = (1.0/0.0) ;

    double coshValue = StrictMath.cosh(d1); 
    System.out.println("Hyperbolic cosine of d1 = " + coshValue);
        
    coshValue = StrictMath.cosh(d2); 
    System.out.println("Hyperbolic cosine of d2 = " + coshValue);
        
    coshValue = StrictMath.cosh(d3); 
    System.out.println("Hyperbolic cosine of d3 = " + coshValue);
  }
}

The code above generates the following result.