PHP cosh() Function

Definition

The cosh() function returns the hyperbolic cosine of a number (equivalent to (exp(number) + exp(-number)) / 2).

Syntax

PHP cosh() Function has the following syntax.

cosh(number);

Parameter

ParameterIs Required Description
numberRequired. A number

Return

Item Description
Return Value The hyperbolic cosine of number
Return TypeFloat

Example

Return the hyperbolic cosine of different numbers:


<?php/*from ww  w  . j a  v a2  s  .  co m*/
echo(cosh(3) . "\n");
echo(cosh(-3) . "\n");
echo(cosh(0) . "\n");
echo(cosh(M_PI) . "\n");
echo(cosh(2*M_PI));
?>

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