Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

tanh()

Example

Provide the hyperbolic tangent values for various numbers.

System.out.println(Math.tanh(3));
System.out.println(Math.tanh(-3));
System.out.println(Math.tanh(0));
System.out.println(Math.tanh(1));

Definition and Usage

The tanh() method computes the hyperbolic tangent of a number.

The hyperbolic tangent can be expressed as Math.sinh(number) / Math.cosh(number).

Syntax

public static double tanh(double number)

Parameter Values

Parameter

Description

number

Required. A number to find the hyperbolic tangent of.

Technical Details

Returns:

“A double value indicating the hyperbolic tangent of a number.”

Java Version:

1.5+