Java StrictMath.tanh(double x)

Syntax

StrictMath.tanh(double x) has the following syntax.

public static double tanh(double x)

Example

In the following code shows how to use StrictMath.tanh(double x) method.


//from   w  ww  . ja v a 2 s.c  o m

public class Main {

  public static void main(String[] args) {
  
    double d1 = (90*Math.PI)/180 , d2 = 0.0;
    double d3 = (1.0)/(0.0), d4 = -(1.0)/(0.0);

    System.out.println("hyperbolic tangent of d1 = " + StrictMath.tanh(d1));
        
    System.out.println("hyperbolic tangent of d2 = " + StrictMath.tanh(d2));
        
    System.out.println("hyperbolic tangent of d3 = " + StrictMath.tanh(d3));
        
    System.out.println("hyperbolic tangent of d4 = " + StrictMath.tanh(d4));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable