Home >>Java Math Methods >Java Math.sinh() method

Java Math.sinh() method

Java Math.sinh() method

The Math.sinh() method in Java Math is used to return the hyperbolic sine of a number. Any value x can be defined as the hyperbolic sine (ex-e -x)/2, where e is an Euler number.

Syntax:

public static double sinh(double x)

Parameter

x = This parameter is used to the number whose hyperbolic sine is to be returned.

Return

It is used to returns the hyperbolic sine of x.

  1. This method will return hyperbolic Sine value if the statement is positive or negative number.
  2. This method must return Infinity with the same sign as the argument if the argument is Infinity.
  3. This method returns -1 if the argument is -1.
  4. If Zero is the argument, the method returns Zero with the same sign as the argument.
Java Math.sinh() method Example 1

public class MyClass  
{  
public static void main(String[] args)   
{  
double x = 15;  
System.out.println(Math.sinh(x));  
}  
}  

Output:-
1634508.6862359024
Java Math.sinh() method Example 2

public class MyClass  
{  
public static void main(String[] args)   
{  
double x = -2.0/0;  
System.out.println(Math.sinh(x));  
}  
}  

Output:-
-Infinity

No Sidebar ads