Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP tanh() Function

PHP tanh() Function

PHP Math Reference Manual PHP Math Reference Manual

Example

Return the hyperbolic tangent of different numbers:

"); echo(tanh(0.50) . "
"); echo(tanh(-0.50) . "
"); echo(tanh(5) . "
"); echo(tanh(10) . "
"); echo(tanh(-5) . "
"); echo(tanh(-10)); ?>

Run Example »


Definition and Usage

The tanh() function returns the hyperbolic tangent of a number, defined as sinh(x)/cosh(x).


Syntax

tanh(

number

);

Parameters Description
number Required. Specifies a number.

Technical Details

Return Value: number The hyperbolic tangent of.
Return Type: Float
PHP Version: 4.1+

PHP Math Reference Manual PHP Math Reference Manual