Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: PowerPC Numerics / Part 2 - The PowerPC Numerics C Implementation
Chapter 10 - Transcendental Functions / Hyperbolic Functions


cosh

You can use the cosh function to compute the hyperbolic cosine of a real number.

double_t cosh (double_t x);
x
Any floating-point number.
DESCRIPTION
The cosh function returns the hyperbolic cosine of its argument. This function is symmetric.

The acosh function performs the inverse operation (arccosh(y)) .

EXCEPTIONS
When x is finite and nonzero, the result of cosh(x) might raise one of the following exceptions:

  • inexact (for all finite, nonzero values of x)
  • overflow (if the result is outside the range of the data type)

SPECIAL CASES
Table 10-27 shows the results when the argument to the cosh function is a zero, a NaN, or an Infinity.
Special cases for the cosh function
OperationResultExceptions raised
cosh(+0) +1None
cosh(-0) +1None
cosh(NaN) NaNNone[49]
cosh(+ ) + None
cosh(- ) + None

EXAMPLES
z = cosh(1.0);    /* z  1.54308. The inexact exception is 
                     raised. */
z = cosh(-1.0);   /* z  1.54308. The inexact exception is 
                     raised. */

[49] If the NaN is a signaling NaN, the invalid exception is raised.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996