/cln-1.3.2/src/real/transcendental/cl_R_cosh.cc
C++ | 34 lines | 18 code | 9 blank | 7 comment | 3 complexity | 32d8cbea4c8ed740a46a11b0661ca5ed MD5 | raw file
Possible License(s): GPL-2.0
- // cosh().
- // General includes.
- #include "base/cl_sysdep.h"
- // Specification.
- #include "cln/real.h"
- // Implementation.
- #include "cln/float.h"
- #include "real/cl_R.h"
- namespace cln {
- const cl_R cosh (const cl_R& x)
- {
- // Methode:
- // x rational -> bei x=0 1 als Ergebnis, sonst x in Float umwandeln.
- // x Float -> bekannt.
- if (rationalp(x)) {
- DeclareType(cl_RA,x);
- if (zerop(x)) // x=0 -> 1 als Ergebnis
- return 1;
- return cosh(cl_float(x)); // sonst in Float umwandeln
- } else {
- DeclareType(cl_F,x);
- return cosh(x);
- }
- }
- } // namespace cln