]> www.ginac.de Git - cln.git/blobdiff - src/float/lfloat/elem/cl_LF_compare.cc
Use paths relative the `src' directory in the #include directives.
[cln.git] / src / float / lfloat / elem / cl_LF_compare.cc
index 1a2e97c4f44fb829a3b2cc63b8b9507439f051e8..521ede824234abf22812ed81b20229129052e81f 100644 (file)
@@ -1,22 +1,23 @@
-// cl_compare().
+// compare().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_lfloat.h"
+#include "cln/lfloat.h"
 
 
 // Implementation.
 
-#include "cl_LF.h"
-#include "cl_DS.h"
+#include "float/lfloat/cl_LF.h"
+#include "base/digitseq/cl_DS.h"
 
-#undef MAYBE_INLINE
-#define MAYBE_INLINE inline
-#include "cl_LF_minusp.cc"
+#include "base/cl_inline.h"
+#include "float/lfloat/elem/cl_LF_minusp.cc"
 
-cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
+namespace cln {
+
+cl_signean compare (const cl_LF& x, const cl_LF& y)
 {
 // Methode:
 // x und y haben verschiedenes Vorzeichen ->
@@ -25,13 +26,13 @@ cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
 // x und y haben gleiches Vorzeichen ->
 //    x >=0 -> vergleiche x und y (die rechten 24 Bits)
 //    x <0 -> vergleiche y und x (die rechten 24 Bits)
-      if (!minusp(y))
+      if (!minusp_inline(y))
         // y>=0
-        { if (!minusp(x))
+        { if (!minusp_inline(x))
             // y>=0, x>=0
             { // Vergleiche Exponenten und Mantissen:
-              { var uintL x_uexp = TheLfloat(x)->expo;
-                var uintL y_uexp = TheLfloat(y)->expo;
+              { var uintE x_uexp = TheLfloat(x)->expo;
+                var uintE y_uexp = TheLfloat(y)->expo;
                 if (x_uexp < y_uexp) return signean_minus; // x<y
                 if (x_uexp > y_uexp) return signean_plus; // x>y
               }
@@ -42,17 +43,17 @@ cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
                 var cl_signean erg =
                   compare_loop_msp(arrayMSDptr(TheLfloat(x)->data,x_len),arrayMSDptr(TheLfloat(y)->data,y_len),len);
                 if (!(erg==0)) { return erg; } // verschieden -> fertig
-                // gemeinsames Teilstück war gleich
-                if (x_len == y_len) { return signean_null; } // gleiche Länge -> fertig
+                // gemeinsames Teilstück war gleich
+                if (x_len == y_len) { return signean_null; } // gleiche Länge -> fertig
                 if (x_len > y_len)
-                  // x länger als y
+                  // x länger als y
                   { if (DS_test_loop(arrayMSDptr(TheLfloat(x)->data,x_len) mspop y_len,x_len-y_len,arrayLSDptr(TheLfloat(x)->data,x_len)))
                       { return signean_plus; } // x>y
                       else
                       { return signean_null; }
                   }
                   else
-                  // y länger als x
+                  // y länger als x
                   { if (DS_test_loop(arrayMSDptr(TheLfloat(y)->data,y_len) mspop x_len,y_len-x_len,arrayLSDptr(TheLfloat(y)->data,y_len)))
                       { return signean_minus; } // x<y
                       else
@@ -64,14 +65,14 @@ cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
             { return signean_minus; } // x<y
         }
         else
-        { if (!minusp(x))
+        { if (!minusp_inline(x))
             // y<0, x>=0
             { return signean_plus; } // x>y
             else
             // y<0, x<0
             { // Vergleiche Exponenten und Mantissen:
-              { var uintL x_uexp = TheLfloat(x)->expo;
-                var uintL y_uexp = TheLfloat(y)->expo;
+              { var uintE x_uexp = TheLfloat(x)->expo;
+                var uintE y_uexp = TheLfloat(y)->expo;
                 if (x_uexp < y_uexp) return signean_plus; // |x|<|y| -> x>y
                 if (x_uexp > y_uexp) return signean_minus; // |x|>|y| -> x<y
               }
@@ -82,17 +83,17 @@ cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
                 var cl_signean erg =
                   compare_loop_msp(arrayMSDptr(TheLfloat(y)->data,y_len),arrayMSDptr(TheLfloat(x)->data,x_len),len);
                 if (!(erg==0)) { return erg; } // verschieden -> fertig
-                // gemeinsames Teilstück war gleich
-                if (x_len == y_len) { return signean_null; } // gleiche Länge -> fertig
+                // gemeinsames Teilstück war gleich
+                if (x_len == y_len) { return signean_null; } // gleiche Länge -> fertig
                 if (x_len > y_len)
-                  // x länger als y
+                  // x länger als y
                   { if (DS_test_loop(arrayMSDptr(TheLfloat(x)->data,x_len) mspop y_len,x_len-y_len,arrayLSDptr(TheLfloat(x)->data,x_len)))
                       { return signean_minus; } // |x|>|y| -> x<y
                       else
                       { return signean_null; }
                   }
                   else
-                  // y länger als x
+                  // y länger als x
                   { if (DS_test_loop(arrayMSDptr(TheLfloat(y)->data,y_len) mspop x_len,y_len-x_len,arrayLSDptr(TheLfloat(y)->data,y_len)))
                       { return signean_plus; } // |x|<|y| -> x>y
                       else
@@ -101,3 +102,5 @@ cl_signean cl_compare (const cl_LF& x, const cl_LF& y)
             } }
         }
 }
+
+}  // namespace cln