]> www.ginac.de Git - cln.git/blobdiff - src/float/dfloat/elem/cl_DF_div.cc
* */*: Remove cl_boolean, cl_true, and cl_false in favor of built-in
[cln.git] / src / float / dfloat / elem / cl_DF_div.cc
index 3c18e5a71718a76634e1dfceac5b522f2287e611..786b866b15cd1cb88c87422943083ca467893999 100644 (file)
@@ -4,7 +4,7 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_dfloat.h"
+#include "cln/dfloat.h"
 
 
 // Implementation.
 #include "cl_low.h"
 #include "cl_DS.h"
 #include "cl_ieee.h"
-NEED_IEEE_FLOATS()
 
 #undef MAYBE_INLINE
 #define MAYBE_INLINE inline
 #include "cl_DF_zerop.cc"
 
+namespace cln {
+
+NEED_IEEE_FLOATS()
+
 const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
 {
 // Methode:
@@ -66,10 +69,10 @@ const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
       #if (cl_word_size==64)
       var uint64 mantx1;
       var uint64 mantx2;
-      DF_decode(x2, { cl_error_division_by_0(); }, sign2=,exp2=,mantx2=);
+      DF_decode(x2, { throw division_by_0_exception(); }, sign2=,exp2=,mantx2=);
       DF_decode(x1, { return x1; }, sign1=,exp1=,mantx1=);
       #else
-      DF_decode2(x2, { cl_error_division_by_0(); }, sign2=,exp2=,manthi2=,mantlo2=);
+      DF_decode2(x2, { throw division_by_0_exception(); }, sign2=,exp2=,manthi2=,mantlo2=);
       DF_decode2(x1, { return x1; }, sign1=,exp1=,manthi1=,mantlo1=);
       #endif
       exp1 = exp1 - exp2; // Differenz der Exponenten
@@ -142,7 +145,7 @@ const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
        // q = 2^32*manthi+mantlo.
        #if (cl_word_size==64)
        #if (intDsize<=32)
-       mantx = (manthi<<32) | (uint64)mantlo;
+       mantx = ((uint64)manthi<<32) | (uint64)mantlo;
        #endif
        if (mantx >= bit(DF_mant_len+2))
          // Quotient >=2^54 -> 2 Bits wegrunden
@@ -220,3 +223,5 @@ const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
       #endif
 #endif
 }
+
+}  // namespace cln