]> www.ginac.de Git - cln.git/blobdiff - src/float/division/cl_F_round22.cc
Initial revision
[cln.git] / src / float / division / cl_F_round22.cc
diff --git a/src/float/division/cl_F_round22.cc b/src/float/division/cl_F_round22.cc
new file mode 100644 (file)
index 0000000..5ed1887
--- /dev/null
@@ -0,0 +1,22 @@
+// round2().
+
+// General includes.
+#include "cl_sysdep.h"
+
+// Specification.
+#include "cl_float.h"
+
+
+// Implementation.
+
+#include "cl_F.h"
+
+const cl_F_div_t round2 (const cl_F& x, const cl_F& y)
+{
+// Methode:
+// (q,r) := round(x/y). Liefere q und x-y*q = y*r.
+       var cl_F_div_t q_r = round2(x/y);
+       var cl_I& q = q_r.quotient;
+       var cl_F& r = q_r.remainder;
+       return cl_F_div_t(q,y*r);
+}