package javaapplication1;
public class JavaApplication1 {
public static void main(String[] args) {
System.out.println("Math.tanh(45 * Math.PI / 180.0) = " + Math.tanh(45 * Math.PI/180.0));
System.out.println("Math.tanh(3 * Math.PI / 4) = " + Math.tanh(3 * Math.PI / 4));
System.out.println("Math.tanh(5 * Math.PI / 4) = " + Math.tanh(5 * Math.PI / 4));
System.out.println("Math.tanh(7 * Math.PI / 4) = " + Math.tanh(7 * Math.PI / 4));
System.out.println("Math.tanh(Math.PI / 4) = " + Math.tanh(Math.PI / 4));
System.out.println("Math.tanh(0) = " + Math.tanh(0));
System.out.println("Math.tanh(-0) = " + Math.tanh(-0));
System.out.println("Math.tanh(1) = " + Math.tanh(1));
System.out.println("Math.tanh(Infinity) = " + Math.tanh(Double.POSITIVE_INFINITY));
}
}
/*
run:
Math.tanh(45 * Math.PI / 180.0) = 0.6557942026326724
Math.tanh(3 * Math.PI / 4) = 0.9821933800072388
Math.tanh(5 * Math.PI / 4) = 0.9992238948786412
Math.tanh(7 * Math.PI / 4) = 0.9999664489997958
Math.tanh(Math.PI / 4) = 0.6557942026326724
Math.tanh(0) = 0.0
Math.tanh(-0) = 0.0
Math.tanh(1) = 0.7615941559557649
Math.tanh(Infinity) = 1.0
*/