- 0
Notifications Mark All Read
No New notification
- Login
- Get Prime
Java Math sinh() Method
Java Math Class
Java Math class provides several methods to perform several operations on math calculations like max(), min(), sin(), cos(), round(), ceil(), floor(), abs() etc.
The java.lang.Math class contains various methods for performing basic numeric operations
Here, in the page we will discuss about the math sinh() Method in java.
Java Math sinh() Method :
Returns the hyperbolic sine of a double value. The hyperbolic sine of x is defined to be (ex – e-x)/2 where e is Euler’s number.
Special Points :
- If the argument is NaN, then the result is NaN.
- If the argument is infinite, then the result is an infinity with the same sign as the argument.
- If the argument is zero, then the result is a zero with the same sign as the argument.
Syntax :
public static double sinh(double x)
Example 1 :
public class Main{ public static void main(String[] args) {
double x = 1.0; // value for which to calculate hyperbolic sine
double sinh = Math.sinh(x); // calculate hyperbolic sine of x
System.out.println("Hyperbolic sine of 1.0: " + sinh); } }
Output :
Hyperbolic sine of 1.0: 1.1752011936438014
Example 2 :
public class Main { public static void main(String[] args) { // case: argument is NaN double value = Double.NaN; double sinh = Math.sinh(value); System.out.println("Hyperbolic sine of " + value + ": " + sinh); // output: NaN // case: argument is infinite value = Double.POSITIVE_INFINITY; sinh = Math.sinh(value); System.out.println("Hyperbolic sine of " + value + ": " + sinh); // output: Infinity value = Double.NEGATIVE_INFINITY; sinh = Math.sinh(value); System.out.println("Hyperbolic sine of " + value + ": " + sinh); // output: -Infinity // case: argument is zero value = 0.0; sinh = Math.sinh(value); System.out.println("Hyperbolic sine of " + value + ": " + sinh); // output: 0.0 } }
Output :
Hyperbolic sine of NaN: NaN Hyperbolic sine of Infinity: Infinity Hyperbolic sine of -Infinity: -Infinity Hyperbolic sine of 0.0: 0.0
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment