sinh() in Java

sinh(): This method is available in the Math class of Java.

Syntax:

double java.lang.Math.sinh(double x)

This method takes one argument of type double as its parameter. This method returns the hyperbolic sine of a double value. 

The hyperbolic sine of x is defined to be (e^x - e^-x)/2

where e is Euler's number.

Special cases:

1. If the argument is NaN, then the result is NaN.

2. If the argument is infinite, then the result is an infinity with the same sign as the argument.

3. If the argument is zero, then the result is a zero with the same sign as the argument.

Parameters: One parameter is required for this method.

x: The number whose hyperbolic sine is to be returned.

Returns: The hyperbolic sine of x.

For Example:

Math.sinh(2.7) = > It returns 7.406263106066543

Approach

Java

public class Sinh {
    public static void main(String[] args) {

        double x = 2.7;
        System.out.println(Math.sinh(x));

    }
}

Output:

7.406263106066543

No comments:

Post a Comment