×

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

Related Topics

Multithreading Program in Java

Multithreading Program in Java: Before discussing multithreading, it is important to discuss threads. Threads are the most fundamental part of a process. A process can have one or more threads....

4 minutes read.

Java FileOutputStream

What is FileOutputStream?When we need raw stream data written into a file, we need to look for another option: FileOutputStream. It is used when the file's data is byte-oriented. It comes under...

4 minutes read.

Zygodromes in Java

Zygodrome is a positive number created by the same digits running non-trivially. A number is called a zygodrome if identical digits constantly occur together (in pairs). The Greek word "zyg"...

4 minutes read.

Hashtable in Java

Hashtable in Java The Hashtable class implements the Map interface and extends the Dictionary class. It implements a hash table which shows the key-value relation, i.e., it maps the keys to the values....

9 minutes read.

Program to check whether a given character is present in a string or not

In this article, you will understand the logic to find out whether the given character is present in the string or not and find out the position of the specified...

3 minutes read.

Spliterator in Java 8

In this tutorial, we will understand the meaning of spliterator in java 8. It is just like any other iterator available in java used to traverse the elements of either...

4 minutes read.

How to Reverse a String in Java

How to Reverse a String in Java There are a lot of ways to reverse a string in Java. One can use iteration, StringBuilder, StringBuffer to do the reverse of a...

6 minutes read.

Java Extends vs Implements

Java: We known that the java is a pure object oriented programming language. Java programming language consists of many features such as portable, plat form independence, secured, robust, simple, architecture neutral,...

4 minutes read.

Console Errors in Java

An unlawful motion taken through the person that reasons this system to act abnormally is amistake until this system is compiled or run; maximum programming mistakes pass unnoticed.The software is...

3 minutes read.

RMI program in Java

Remote Method Invocation is what it stands for. An object can call the method of another object in a different space address using the RMI API, which may be on the...

3 minutes read.

Singleton Design Pattern in Java

In the singleton pattern, a class that only has one instance and offers a universal point of access is taken into consideration. It can also be defined in another way, a...

4 minutes read.

How to Convert Hexadecimal to Decimal in Java

How to Convert Hexadecimal to Decimal in Java There are two methods to convert Hexadecimal to Decimal: Using parseInt() method Using user-defined logic Using Integer.parseInt() method It is a static method of...

2 minutes read.

History and Evolution of Java

Java is invented by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. Java is related to C++, which is inherited from...

3 minutes read.

Java Integer decode() method

The decode() method of Integer class decodes a String into an Integer. It can accept decimal, hexadecimal and octal numbers. Syntax public static Integer decode(String nm) throws NumberFormatException Parameters The parameter ‘nm’ represents the...

2 minutes read.

Difference between C, C++, java

C Language: C language is a procedure oriented language. It has been invented by Dennis Ritchie in the year 1970. It is one of the computer programming language. The purpose of...

3 minutes read.

How to compare three dates in Java?

While using the date and the time in Java, we occasionally have to compare the dates. Java does not compare dates the same way it compares the two numbers. Therefore,...

6 minutes read.

Java Wrapper classes

Java Wrapper classes A wrapper class is a class whose object contains a primitive data type; moreover it provides a way to use primitive data type (int, boolean, etc.) as objects. Wrapper...

2 minutes read.

Java Serialization

JAVA SERIALIZATION Serialization is a process by which objects can be represented as a sequence of bytes. These bytes have information about object's data, object's type and datatypes of members in...

3 minutes read.

Buffer reader to read string in Java

The Buffered Reader class of Java is used to read the stream of characters from the input stream. Program to read string using Buffer reader import java.io.*; class  Demo {   public static void main(String...

3 minutes read.

Perfect Number Program in Java

Perfect Number Program in Java A perfect number is a number whose sum of all the factors, excluding the number itself, is equal to the number. For example, 28 is a...

4 minutes read.