]> www.ginac.de Git - cln.git/blobdiff - src/float/dfloat/elem/cl_DF_div.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / float / dfloat / elem / cl_DF_div.cc
index d5e954193c63a6b8e9044e1ea2d5b0ddf0a844c9..878f8f8a52dd8a4dbb03faee46b5daad4577dd23 100644 (file)
@@ -1,7 +1,7 @@
 // binary operator /
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
 #include "cln/dfloat.h"
@@ -9,20 +9,17 @@
 
 // Implementation.
 
-#include "cl_DF.h"
-#include "cl_N.h"
-#include "cl_F.h"
-#include "cl_low.h"
-#include "cl_DS.h"
-#include "cl_ieee.h"
+#include "float/dfloat/cl_DF.h"
+#include "base/cl_N.h"
+#include "float/cl_F.h"
+#include "base/cl_low.h"
+#include "base/digitseq/cl_DS.h"
 
-#undef MAYBE_INLINE
-#define MAYBE_INLINE inline
-#include "cl_DF_zerop.cc"
+#include "base/cl_inline.h"
+#include "float/dfloat/elem/cl_DF_zerop.cc"
 
 namespace cln {
 
-NEED_IEEE_FLOATS()
 
 const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
 {
@@ -37,20 +34,20 @@ const cl_DF operator/ (const cl_DF& x1, const cl_DF& x2)
 //   nach Rundung mant1/mant2 >=1/2, <=2*mant1<2.
 //   Bei mant1/mant2 >=1 brauche 52 Nachkommabits,
 //   bei mant1/mant2 <1 brauche 53 Nachkommabits.
-//   Fürs Runden: brauche ein Rundungsbit (Rest gibt an, ob exakt).
+//   Fürs Runden: brauche ein Rundungsbit (Rest gibt an, ob exakt).
 //   Brauche daher insgesamt 54 Nachkommabits von mant1/mant2.
 //   Dividiere daher (als Unsigned Integers) 2^54*(2^53*mant1) durch (2^53*mant2).
 //   Falls der Quotient >=2^54 ist, runde die letzten zwei Bits weg und
-//     erhöhe den Exponenten um 1.
+//     erhöhe den Exponenten um 1.
 //   Falls der Quotient <2^54 ist, runde das letzte Bit weg. Bei rounding
 //     overflow schiebe um ein weiteres Bit nach rechts, incr. Exponenten.
 #if defined(FAST_DOUBLE) && !defined(__i386__)
       double_to_DF(DF_to_double(x1) / DF_to_double(x2), return ,
                    TRUE, TRUE, // Overflow und subnormale Zahl abfangen
-                   !zerop(x1), // ein Ergebnis +/- 0.0
+                   !zerop_inline(x1), // ein Ergebnis +/- 0.0
                                // ist genau dann in Wirklichkeit ein Underflow
-                   zerop(x2), // Division durch Null abfangen
-                   FALSE // kein NaN als Ergebnis möglich
+                   zerop_inline(x2), // Division durch Null abfangen
+                   FALSE // kein NaN als Ergebnis möglich
                   );
 #else
       // x1,x2 entpacken:
@@ -69,17 +66,17 @@ 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
       sign1 = sign1 ^ sign2; // Ergebnis-Vorzeichen
-      // Dividiere 2^54*mant1 durch mant2 oder (äquivalent)
-      // 2^i*2^54*mant1 durch 2^i*mant2 für irgendein i mit 0 <= i <= 64-53 :
-      // wähle i = 64-(DF_mant_len+1), also i+(DF_mant_len+2) = 65.
+      // Dividiere 2^54*mant1 durch mant2 oder (äquivalent)
+      // 2^i*2^54*mant1 durch 2^i*mant2 für irgendein i mit 0 <= i <= 64-53 :
+      // wähle i = 64-(DF_mant_len+1), also i+(DF_mant_len+2) = 65.
       #if (cl_word_size==64)
       mantx1 = mantx1 << 1;
       mantx2 = mantx2 << (64-(DF_mant_len+1));