PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/cln-1.3.2/src/real/transcendental/cl_R_coshsinh.cc

#
C++ | 34 lines | 18 code | 9 blank | 7 comment | 3 complexity | 9d0d0dcd5e6ec361d543cce66b30cd57 MD5 | raw file
Possible License(s): GPL-2.0
  1. // cosh_sinh().
  2. // General includes.
  3. #include "base/cl_sysdep.h"
  4. // Specification.
  5. #include "cln/real.h"
  6. // Implementation.
  7. #include "cln/float.h"
  8. #include "real/cl_R.h"
  9. namespace cln {
  10. const cosh_sinh_t cosh_sinh (const cl_R& x)
  11. {
  12. // Methode:
  13. // x rational -> bei x=0 (1,0) als Ergebnis, sonst x in Float umwandeln.
  14. // x Float -> bekannt.
  15. if (rationalp(x)) {
  16. DeclareType(cl_RA,x);
  17. if (zerop(x)) // x=0 -> (1,0) als Ergebnis
  18. return cosh_sinh_t(1,0);
  19. return cosh_sinh(cl_float(x)); // sonst in Float umwandeln
  20. } else {
  21. DeclareType(cl_F,x);
  22. return cosh_sinh(x);
  23. }
  24. }
  25. } // namespace cln