Java Onlines
Java Sandbox
Java Benchmark
Math
String
Python Sandbox
PHP Sandbox
Java Sandbox
Java Benchmark
Math
String
Python Sandbox
PHP Sandbox
Online Java tanh() function
tanh
- Returns the hyperbolic tangent of a double value
Title
public class Main { public static void main(String[] args) { double a = 30; // converting values to radian double b = Math.toRadians(a); // return the trigonometric sine of a System.out.println("Sine value of a is: " +Math.sin(a)); // return the trigonometric cosine value of a System.out.println("Cosine value of a is: " +Math.cos(a)); // return the trigonometric tangent value of a System.out.println("Tangent value of a is: " +Math.tan(a)); // return the trigonometric arc sine of a System.out.println("Sine value of a is: " +Math.asin(a)); // return the trigonometric arc cosine value of a System.out.println("Cosine value of a is: " +Math.acos(a)); // return the trigonometric arc tangent value of a System.out.println("Tangent value of a is: " +Math.atan(a)); // return the hyperbolic sine of a System.out.println("Sine value of a is: " +Math.sinh(a)); // return the hyperbolic cosine value of a System.out.println("Cosine value of a is: " +Math.cosh(a)); // return the hyperbolic tangent value of a System.out.println("Tangent value of a is: " +Math.tanh(a)); } }
Run on Java version:
14
14.0.1
14
13
13.0.2
13.0.1
13
12
12.0.2
12.0.1
12
11
11.0.7
11.0.6
11.0.5
11.0.4
11.0.3
11.0.2
11.0.1
11
10
10.0.2
10.0.1
10
9
9.0.4
9.0.1
9
8
8
7
7
6
6
Execute Code
Math Functions
abs
acos
asin
atan
atan2
cbrt
ceil
copySign
cos
cosh
exp
expm1
floor
getExponent
hypot
IEEEremainder
log
log10
log1p
max
min
nextAfter
nextUp
pow
random
rint
round
signum
sin
sinh
sqrt
tan
tanh
toDegrees
toRadians
ulp