Java.lang.StrictMath.sinh() Method

Advertisements


Description

The java.lang.StrictMath.sinh() method returns the hyperbolic sine of a double value. The hyperbolic sine of x is defined to be (ex - e-x)/2 where e is Euler's number.It include these cases:

  • If the argument is NaN or an infinity, then the result is NaN.
  • If the argument is infinite, then the result is an infinity with the same sign as the argument.
  • If the argument is zero, then the result is a zero with the same sign as the argument.

Declaration

Following is the declaration for java.lang.StrictMath.sinh() method

public static double sinh(double x)

Parameters

  • x -- This is the number whose hyperbolic sine is to be returned.

Return Value

This method returns the hyperbolic sine of x.

Exception

  • NA

Example

The following example shows the usage of java.lang.StrictMath.sinh() method.

package com.tutorialspoint;

import java.lang.*;

public class StrictMathDemo {

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

    // returns the hyperbolic sine of a double value

    double sinhValue = StrictMath.sinh(d1); 
    System.out.println("Hyperbolic sine of d1 = " + sinhValue);
        
    sinhValue = StrictMath.sinh(d2); 
    System.out.println("Hyperbolic sine of d2 = " + sinhValue);
        
    sinhValue = StrictMath.sinh(d3); 
    System.out.println("Hyperbolic sine of d3 = " + sinhValue);
  }
}

Let us compile and run the above program, this will produce the following result:

Hyperbolic sin of d1 = 2.3012989023072947
Hyperbolic sin of d2 = 2.592352764293536E21
Hyperbolic sin of d3 = 0.0



Advertisements
Advertisements