w3resource

PHP: cosh() function

Description

The cosh() function is used to get the hyperbolic cosine of a number.

Version:

(PHP 4 and above)

Syntax:

cosh(num)

Parameter:

Name Description Required /
Optional
Type
num A number. Required Float

Return value:

The hyperbolic cosine of num.

Value Type: Float.

Example:


<?php
echo(cosh(4) . '<br>');
echo(cosh(-4) . '<br>');
echo(cosh(0) . '<br>');
echo(cosh(M_PI) . "<br>");
echo(cosh(M_PI_2));
?>

Output :

27.308232836
27.308232836
1
11.5919532755
2.50917847866 

View the example in the browser

See also

PHP Function Reference

Previous: cos
Next: decbin



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/php/function-reference/cosh.php