PHP cosh() Function

In this chapter you will learn:

  1. Definition for PHP cosh() Function
  2. Syntax for PHP cosh() Function
  3. Parameter for PHP cosh() Function
  4. Return for PHP cosh() Function
  5. Example - Return the hyperbolic cosine of different numbers

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// ja v a 2 s  . c o  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.

Next chapter...

What you will learn in the next chapter:

  1. Definition for PHP decbin() Function
  2. Syntax for PHP decbin() Function
  3. Parameter for PHP decbin() Function
  4. Return for PHP decbin() Function
  5. Example - converts a decimal number into a binary number