strictmath
StrictMath类sinh()方法 (StrictMath Class sinh() method)
sinh() method is available in java.lang package.
sinh()方法在java.lang包中可用。
sinh() method is used to return the hyperbolic sine of an angle of the given parameter in the method. Here, "sinh" stands for hyperbolic sine of an angle.
sinh()方法用于返回该方法中给定参数角度的双曲正弦值。 在此,“ sinh”代表某个角度的双曲正弦。
sinh() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get any error.
sinh()方法是静态方法,因此可以使用类名进行访问,如果尝试使用类对象访问该方法,则不会收到任何错误。
In sinh() method we pass only radians type argument (i.e. First we convert given argument in radians by using toRadians() method of StrictMath class then after we will pass the same variable in sinh() method).
在sinh()方法中,我们仅传递弧度类型的参数(即,首先,我们使用StrictMath类的toRadians()方法将给定参数转换为弧度,然后在sinh()方法中传递相同的变量)。
sinh() method does not throw any exception at the time of returning hyperbolic sine of an angle.
返回角度的双曲正弦时, sinh()方法不会引发任何异常。
Syntax:
句法:
public static double sinh(double d);
Parameter(s):
参数:
double d – represents the value whose hyperbolic sine of an angle is to be returned.
double d –表示要返回其角度的双曲正弦的值。
Return value:
返回值:
The return type of this method is double – it returns the hyperbolic sine value of the given argument.
这种方法的返回类型是双 -它返回给定参数的双曲正弦值。
Note:
注意:
If we pass NaN, the method returns NaN.
如果传递NaN,则该方法返回NaN。
If we pass an infinity (positive or negative), the method returns the same value.
如果我们传递无穷大(正数或负数),则该方法将返回相同的值。
If we pass a zero (positive or negative), the method returns the 0.0.
如果传递零(正数或负数),则该方法返回0.0。
Example:
例:
// Java program to demonstrate the example of
// sinh(double d) method of StrictMath class.
public class Sinh {
public static void main(String[] args) {
// variable declaration
double d1 = 7.0 / 0.0;
double d2 = -7.0 / 0.0;
double d3 = 0.0;
double d4 = -0.0;
double d5 = 60.0;
// Display previous value of d1,d2,d3,d4 and d5
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
System.out.println("d4: " + d4);
System.out.println("d5: " + d5);
// By using toRadians() method to convert
// absolute value into radians.
d1 = StrictMath.toRadians(d1);
d2 = StrictMath.toRadians(d2);
d3 = StrictMath.toRadians(d3);
d4 = StrictMath.toRadians(d4);
d5 = StrictMath.toRadians(d5);
// Here , we will get (infinity) because we are
// passing parameter whose value is (7.0/0.0)
System.out.println("StrictMath.sinh(d1): " + StrictMath.sinh(d1));
// Here , we will get (-infinity) because we are
// passing parameter whose value is (-7.0/0.0)
System.out.println("StrictMath.sinh(d2): " + StrictMath.sinh(d2));
// Here , we will get (0.0) because we are passing
// parameter whose value is (0.0)
System.out.println("StrictMath.sinh(d3): " + StrictMath.sinh(d3));
// Here , we will get (-0.0) because we are passing
// parameter whose value is (-0.0)
System.out.println("StrictMath.sinh(d4): " + StrictMath.sinh(d4));
// Here we will find hyperbolic sine of d5 by using sinh() method
System.out.println("StrictMath.sinh(d5): " + StrictMath.sinh(d5));
}
}
Output
输出量
d1: Infinity
d2: -Infinity
d3: 0.0
d4: -0.0
d5: 60.0
StrictMath.sinh(d1): Infinity
StrictMath.sinh(d2): -Infinity
StrictMath.sinh(d3): 0.0
StrictMath.sinh(d4): -0.0
StrictMath.sinh(d5): 1.2493670505239751
翻译自: https://www.includehelp.com/java/strictmath-sinh-method-with-example.aspx
strictmath