PageRenderTime 40ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/cln-1.3.2/src/real/conv/cl_F_from_R.cc

#
C++ | 50 lines | 31 code | 15 blank | 4 comment | 2 complexity | fe2db91378ee73fe7731f87f44483e80 MD5 | raw file
Possible License(s): GPL-2.0
  1. // cl_float().
  2. // General includes.
  3. #include "base/cl_sysdep.h"
  4. // Specification.
  5. #include "cln/real.h"
  6. // Implementation.
  7. #include "real/cl_R.h"
  8. #if 0
  9. namespace cln {
  10. const cl_F cl_float (const cl_R& x, const cl_F& y)
  11. {
  12. if (rationalp(x)) {
  13. DeclareType(cl_RA,x);
  14. return cl_float(x,y);
  15. } else {
  16. DeclareType(cl_F,x);
  17. return cl_float(x,y);
  18. }
  19. }
  20. } // namespace cln
  21. #else // less type dispatch overhead
  22. #include "float/cl_F.h"
  23. #include "float/lfloat/cl_LF.h"
  24. namespace cln {
  25. const cl_F cl_float (const cl_R& x, const cl_F& y)
  26. {
  27. floattypecase(y
  28. , return cl_R_to_SF(x);
  29. , return cl_R_to_FF(x);
  30. , return cl_R_to_DF(x);
  31. , return cl_R_to_LF(x,TheLfloat(y)->len);
  32. );
  33. }
  34. } // namespace cln
  35. #endif