]> www.ginac.de Git - cln.git/blobdiff - src/float/division/cl_F_fround2.cc
Initial revision
[cln.git] / src / float / division / cl_F_fround2.cc
diff --git a/src/float/division/cl_F_fround2.cc b/src/float/division/cl_F_fround2.cc
new file mode 100644 (file)
index 0000000..520f50a
--- /dev/null
@@ -0,0 +1,32 @@
+// fround2().
+
+// General includes.
+#include "cl_sysdep.h"
+
+// Specification.
+#include "cl_float.h"
+
+
+// Implementation.
+
+#include "cl_F.h"
+#include "cl_sfloat.h"
+#include "cl_ffloat.h"
+#include "cl_dfloat.h"
+#include "cl_lfloat.h"
+#include "cl_LF.h"
+
+const cl_F_fdiv_t fround2 (const cl_F& x)
+{
+#if 0 // 3 type dispatches
+       var cl_F q = fround(x);
+       return cl_F_fdiv_t(q,x-q);
+#else // 1 type dispatch
+       floatcase(x
+       ,       var cl_SF q = fround(x); return cl_F_fdiv_t(q,x-q);
+       ,       var cl_FF q = fround(x); return cl_F_fdiv_t(q,x-q);
+       ,       var cl_DF q = fround(x); return cl_F_fdiv_t(q,x-q);
+       ,       var cl_LF q = fround(x); return cl_F_fdiv_t(q,LF_LF_minus_LF(x,q));
+       );
+#endif
+}