The cosh()
function returns the hyperbolic cosine
of a number (equivalent to (exp(number) + exp(-number)) / 2).
PHP cosh() Function has the following syntax.
cosh(number);
Parameter | Is Required | Description |
---|---|---|
number | Required. | A number |
Item | Description |
---|---|
Return Value | The hyperbolic cosine of number |
Return Type | Float |
Return the hyperbolic cosine of different numbers:
<?php
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.