#include <math.h> double cosh(double x);
cosh
computes the hyperbolic cosine of its argument x
, as
expressed by the following relation:
r = (e**x + e**-x)/2
cosh
returns the value of the hyperbolic cosine of the
argument x
, provided that this value is defined and computable. The
return value is a double-precision, floating-point number.
x
with an absolute value too large to be represented, the function
returns HUGE_VAL
. The run-time library writes an error message to
stderr
(the standard error file).
If an error occurs in cosh
, the _matherr
routine is called. You
can supply your own version of _matherr
to suppress the diagnostic
message or modify the value returned.
cosh
:
#include <math.h> #include <stdio.h> #define VALUE 3.76182 main() { double secant_h; /* The hyperbolic secant of VALUE is 1 divided */ /* by the hyperbolic cosine of VALUE. */ secant_h = 1 / cosh(VALUE); printf("1 / cosh(%f) = %fn", VALUE, secant_h); }
sinh
, tanh
, _matherr
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.