# Get the hyperbolic tangent of a given value in Java

Java 8Object Oriented ProgrammingProgramming

In order to get the hyperbolic tangent of a given value in Java, we use the java.lang.Math.tanh() method. The tanh() method accepts an argument in radians and returns the hyperbolic tan of the argument which acts as the angle.

Declaration −The java.lang.Math.tanh() is declared as follows −

public static double tanh(double x)

where, x is the angle in radians.

Let us see a program to get the hyperbolic tangent of a given value in Java.

## Example

Live Demo

import java.lang.Math;
public class Example {
public static void main(String[] args) {
// get two double numbers in degrees
double x = 90;
double y = 180;
}
Hyperbolic tangent of 1.5707963267948966 = 0.9171523356672744
Hyperbolic tangent of 3.141592653589793 = 0.99627207622075