×

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

Check if the given array is mirror inverse in Java

The primary objective is to check whether the given array is mirror inverse or not. The values and position of the specified array are switched, and a duplicate array is created....

3 minutes read.

How to stop execution after a certain time in Java

We will learn how to stop a long-running execution after a set amount of time in this post. We will take a look at a few alternative approaches to this...

6 minutes read.

Multiple Inheritance Programs in Java

A component of the object-oriented notion known as multiple inheritances allows a class to inherit properties from multiple parent classes. When methods that have the same signature are present in...

4 minutes read.

Converting Roman to Integer Numerals in java

In this article, you will be acknowledged about the process of conversion of roman numbers to integers in java. The most important approaches are discussed and also the implementation of...

3 minutes read.

Java Base64 Encoding and Decoding

Introduction to Encoding and Decoding Encoding is the process of putting the sequence of characters like letters, numbers, punctuations, and other symbols into a specialised format for the efficient transmission or...

11 minutes read.

How to set path in Java

To make programs that can run on our systems, we need to install programming language-related software in our systems. Different programming languages require different types of software, aka IDEs (Integrated Development...

5 minutes read.

How to Convert String to Object in Java

How to Convert String to Object in Java The Object is the super class of all classes. So you can assign a string to Object directly. There are two methods to...

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.

Web Crawler in Java

In this article, you will be acknowledged with what a web crawler in java is and what are its functions. You will also be able to understand where to implement...

4 minutes read.

Thread Synchronization in Java

In Java, the smallest processing component is a thread, which is a small subprocess. It follows a different course of action. Threads are autonomous. If an exception occurs in one thread,...

6 minutes read.

Rehashing in Java

The most crucial idea mostly in the data structure is hashing, which is utilized to change a particular key into some other value. The hash function can be used to...

7 minutes read.

How to Call a Method in Java

In Java, a method is a collection of statements that perform a specific task or action.It can accept data with the help ofitsarguments. It  is also called a function. In order...

9 minutes read.

Bad Operand types for Binary Operator Java

We will discuss how to handle issues in bad operand types for binary operator &, bad operand types for binary operator &&, bad operand types for binary operator ==, and...

4 minutes read.

Java Project Ideas

When it comes to constructing projects, Java is regarded as one of the best languages and is also one of the most paid. Java excels in any application, whether it...

10 minutes read.

How to convert double to String in Java

How to Convert double to String in Java It is used when we want to convert double primitive to String type. There are two methods to convert double to String. Using String.valueOf()...

2 minutes read.

How to Convert int to char in Java

To convert a higher data type to lower data type, we need to do typecasting. Casting is also required when we want to convert ASCII value into character. It is...

3 minutes read.

Pattern Programs in Java

Pattern Programs in Java In Java, pattern programs are the most important from the perspective of interviews. The pattern programs improve thinking and coding skills. It also helps us to develop a...

27 minutes read.

Difference between throw and throws in java

This article shows you the core difference between “throw” and “throws”keywords in Java programming language.The throw keyword tells Java you want another part of the code to deal withthe exception,...

2 minutes read.

Java Integer class

The Integer class wraps a primitive int type value in an object. Its object contains only a single field whose type is int. Methods: The java.lang.Integer class provides several different methods for...

4 minutes read.

How to check version of java in Linux

Java is one of the most famous and thoroughly utilized programming tongues from one side of the world to the other. On the off chance that you are a Java...

2 minutes read.