PHP tanh() Function

Definition

The tanh() function returns the hyperbolic tangent of a number, which is equal to sinh(x)/cosh(x).

Syntax

PHP tanh() Function has the following syntax.

tanh(number);

Parameter

Parameter Is Required Description
numberRequired. Specifies a number

Return

Return Description
Return ValueThe hyperbolic tangent of number
Return TypeFloat

Example

Return the hyperbolic tangent of different numbers:


<?php//  w w  w  .  j  a  v a  2s  .co  m
echo(tanh(M_PI_4) . "\n");
echo(tanh(0.5) . "\n");
echo(tanh(-0.5) . "\n");
echo(tanh(5) . "\n");
echo(tanh(1) . "\n");
echo(tanh(-1) . "\n");
echo(tanh(-10));
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions