PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/cln-1.3.2/src/float/division/cl_F_trunc22.cc

#
C++ | 26 lines | 12 code | 8 blank | 6 comment | 0 complexity | 19a1da59b3ec8cff66ca52cf52c95720 MD5 | raw file
Possible License(s): GPL-2.0
  1. // truncate2().
  2. // General includes.
  3. #include "base/cl_sysdep.h"
  4. // Specification.
  5. #include "cln/float.h"
  6. // Implementation.
  7. #include "float/cl_F.h"
  8. namespace cln {
  9. const cl_F_div_t truncate2 (const cl_F& x, const cl_F& y)
  10. {
  11. // Methode:
  12. // (q,r) := truncate(x/y). Liefere q und x-y*q = y*r.
  13. var cl_F_div_t q_r = truncate2(x/y);
  14. var cl_I& q = q_r.quotient;
  15. var cl_F& r = q_r.remainder;
  16. return cl_F_div_t(q,y*r);
  17. }
  18. } // namespace cln