Online Java Compiler By
JavaTpoint.com
public class TanhExample5 { public static void main(String[] args) { double a = -1.0/0; // Input negative infinity, Output negative 1 System.out.println(Math.tanh(a)); } }
Output