PHP cosh() Function – Hyperbolic Cosine

The article explains PHP’s built‑in cosh() function, describing its purpose of returning the hyperbolic cosine of a given float argument, detailing the parameter and return value, and providing several example calls with expected numeric outputs.

Laravel Tech Community
Laravel Tech Community
Laravel Tech Community
PHP cosh() Function – Hyperbolic Cosine

The cosh() function is a built‑in PHP function that returns the hyperbolic cosine of a numeric argument.

Syntax: float cosh(float $arg) Description: It computes the value defined as (exp(arg) + exp(-arg)) / 2.

Parameter: $arg – the float value whose hyperbolic cosine is to be calculated.

Return value: The hyperbolic cosine of $arg as a float.

Example usage:

<?php
echo cosh(3)."<br>";
echo cosh(-3)."<br>";
echo cosh(0)."<br>";
echo cosh(M_PI)."<br>";
echo cosh(2*M_PI);
?>

Sample output:

10.067661995778
10.067661995778
1
11.591953275522
267.74676148375
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

backend-developmentcoshhyperbolic cosinemath functions
Laravel Tech Community
Written by

Laravel Tech Community

Specializing in Laravel development, we continuously publish fresh content and grow alongside the elegant, stable Laravel framework.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.