Home >>Java Math Methods >Java Math.tanh() method
Java Math.tanh() method in Java Math is used to return a value with the hyperbolic tangent. It is possible to define the hyperbolic tangent of any value x as ((ex-e -x)/2)/(((ex + e -x)/2), where e is the number of Euler. We might say the tanh(a) = sinh(a)/cosh(a).
public static double tanh(double x)
x = This parameter is used to the number whose hyperbolic tangent is to be returned.
It is used to returns the hyperbolic tangent of x.
public class MyClass
{
public static void main(String[] args)
{
double x = 7.0;
System.out.println(Math.tanh(x));
}
}
public class MyClass
{
public static void main(String[] args)
{
double x = 45.0;
System.out.println(Math.tanh(x));
}
}