Java Math sinh() Method
The sinh() method of Java Math class returns the hyperbolic sine of the specified double value.
Syntax:
public static double sinh(double x)
Parameters:
The parameter ‘a’ represents the number whose hyperbolic sine is to be determined.
Return Value:
The sinh() method returns the hyperbolic sine of the argument.
- It returns zero with same sign as argument, if the argument passed is zero.
- It returns infinity with the same sign as the argument, if the argument is infinite.
- It returns NaN, if the argument is NaN.
Example 1:
public class JavaMathSinhExample1 { public static void main(String[] args) { double a=30; //return the hyperbolic sine value for a System.out.println("Hyperbolic sine value : "+Math.sinh(a)); } }
Output:
Hyperbolic sine value : 5.343237290762231E12
Example 2:
public class JavaMathSinhExample2 { public static void main(String[] args) { //return the Hyperbolic sine value for Double.MIN_VALUE double a=Double.MIN_VALUE; System.out.println("Hyperbolic sine value for "+a+" = "+Math.sinh(a)); } }
Output:
Hyperbolic sine value for 4.9E-324 = 4.9E-324
Example 3:
public class JavaMathSinhExample3 { public static void main(String[] args) { // return an hyperbolic Sine value for PI double x = Math.PI; System.out.println("Hyperbolic Sine value for "+x+" = "+Math.sinh(x)); } }
Output:
Hyperbolic Sine value for 3.141592653589793 = 11.548739357257748
Example 4:
public class JavaMathSinhExample4 { public static void main(String[] args) { //returns NaN, if the argument passed is NaN or infinity double x= Double.NaN; System.out.println(Math.sinh(x)); } }
Output:
NaN
Example 5:
public class JavaMathSinhExample5 { public static void main(String[] args) { //returns zero with same sign as argument, if the argument passed is zero double x= -0d; System.out.println(Math.sinh(x)); } }
Output:
-0.0