PHP cosh() Function
Example
Return the hyperbolic cosine of different numbers:
<?php
echo(cosh(3) . "<br>");
echo(cosh(-3) . "<br>");
echo(cosh(0) . "<br>");
echo(cosh(M_PI) . "<br>");
echo(cosh(2*M_PI));
?>
Try it Yourself »
Definition and Usage
The cosh() function returns the hyperbolic cosine of a number (equivalent to (exp(number) + exp(-number)) / 2).
Syntax
cosh(number);
Parameter Values
Parameter | Description |
---|---|
number | Required. Specifies a number |
Technical Details
Return Value: | The hyperbolic cosine of number |
---|---|
Return Type: | Float |
PHP Version: | 4.1+ |
❮ PHP Math Reference