]> www.ginac.de Git - cln.git/blobdiff - src/float/lfloat/algebraic/cl_LF_sqrt.cc
Replace unused macro with cl_unused.
[cln.git] / src / float / lfloat / algebraic / cl_LF_sqrt.cc
index ae0719429cdc31a3e5fe0849353ebfe9c479cd8a..b58f598c94c53b81c3e7487d1dc439c17c62abf5 100644 (file)
@@ -1,7 +1,7 @@
 // sqrt().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
 #include "cln/lfloat.h"
@@ -9,10 +9,10 @@
 
 // Implementation.
 
-#include "cl_LF.h"
-#include "cl_LF_impl.h"
-#include "cl_F.h"
-#include "cl_DS.h"
+#include "float/lfloat/cl_LF.h"
+#include "float/lfloat/cl_LF_impl.h"
+#include "float/cl_F.h"
+#include "base/digitseq/cl_DS.h"
 #include "cln/exception.h"
 
 namespace cln {
@@ -42,21 +42,21 @@ const cl_LF sqrt (const cl_LF& x)
       CL_ALLOCA_STACK;
       var uintD* r_MSDptr;
       var uintD* r_LSDptr;
-      var uintC r_len = 2*len+2; // Länge des Radikanden
+      var uintC r_len = 2*len+2; // Länge des Radikanden
       num_stack_alloc(r_len, r_MSDptr=,r_LSDptr=);
       if ((uexp & bit(0)) == (LF_exp_mid & bit(0)))
         // Exponent gerade
         {var uintD* ptr =
            copy_loop_msp(arrayMSDptr(TheLfloat(x)->data,len),r_MSDptr,len); // n Digits kopieren
-         clear_loop_msp(ptr,len+2); // n+2 Nulldigits anh�gen
+         clear_loop_msp(ptr,len+2); // n+2 Nulldigits anh�gen
         }
         else
         // Exponent ungerade
         {var uintD carry_rechts = // n Digits kopieren und um 1 Bit rechts shiften
            shiftrightcopy_loop_msp(arrayMSDptr(TheLfloat(x)->data,len),r_MSDptr,len,1,0);
          var uintD* ptr = r_MSDptr mspop len;
-         msprefnext(ptr) = carry_rechts; // ï¿½ertrag und
-         clear_loop_msp(ptr,len+1); // n+1 Nulldigits anh�gen
+         msprefnext(ptr) = carry_rechts; // Ã¯Â¿Â½ertrag und
+         clear_loop_msp(ptr,len+1); // n+1 Nulldigits anh�gen
         }
       // Compute ((uexp - LF_exp_mid + 1) >> 1) + LF_exp_mid without risking
       // uintE overflow.
@@ -81,7 +81,7 @@ const cl_LF sqrt (const cl_LF& x)
           // Ablegen und runden:
           copy_loop_msp(p_MSDptr mspop 1,y_mantMSDptr,len); // NUDS nach y kopieren
           if (mspref(p_MSDptr,0) == 0)
-            { if ( ((sintD)mspref(p_MSDptr,len+1) >= 0) // n�hstes Bit =0 -> abrunden
+            { if ( ((sintD)mspref(p_MSDptr,len+1) >= 0) // n�hstes Bit =0 -> abrunden
                    || ( ((mspref(p_MSDptr,len+1) & ((uintD)bit(intDsize-1)-1)) ==0) // =1 und weitere Bits >0 -> aufrunden
                         && !test_loop_msp(p_MSDptr mspop (len+2),len+1)
                         // round-to-even (etwas witzlos, da eh alles ungenau ist)
@@ -92,13 +92,13 @@ const cl_LF sqrt (const cl_LF& x)
                 else
                 // aufrunden
                 { if ( inc_loop_lsp(y_mantMSDptr mspop len,len) )
-                    // ï¿½ertrag durchs Aufrunden
+                    // Ã¯Â¿Â½ertrag durchs Aufrunden
                     { mspref(y_mantMSDptr,0) = bit(intDsize-1); // Mantisse := 10...0
                       (TheLfloat(y)->expo)++; // Exponenten incrementieren
                 }   }
             }
             else
-            // ï¿½ertrag durch Rundungsfehler
+            // Ã¯Â¿Â½ertrag durch Rundungsfehler
             { if (test_loop_msp(y_mantMSDptr,len)) throw runtime_exception();
               mspref(y_mantMSDptr,0) = bit(intDsize-1); // Mantisse := 10...0
               (TheLfloat(y)->expo)++; // Exponenten incrementieren
@@ -107,12 +107,12 @@ const cl_LF sqrt (const cl_LF& x)
         }
 #endif
       var DS w;
-      var cl_boolean exactp;
+      var bool exactp;
       UDS_sqrt(r_MSDptr,r_len,r_LSDptr, &w, exactp=);
       // w ist die Ganzzahl-Wurzel, eine n+1-Digit-Zahl.
       copy_loop_msp(w.MSDptr,y_mantMSDptr,len); // NUDS nach y kopieren
       // Runden:
-      if ( ((sintD)lspref(w.LSDptr,0) >= 0) // n�hstes Bit =0 -> abrunden
+      if ( ((sintD)lspref(w.LSDptr,0) >= 0) // n�hstes Bit =0 -> abrunden
            || ( ((lspref(w.LSDptr,0) & ((uintD)bit(intDsize-1)-1)) ==0) // =1 und weitere Bits >0 oder Rest >0 -> aufrunden
                 && exactp
                 // round-to-even
@@ -123,7 +123,7 @@ const cl_LF sqrt (const cl_LF& x)
         else
         // aufrunden
         { if ( inc_loop_lsp(y_mantMSDptr mspop len,len) )
-            // ï¿½ertrag durchs Aufrunden
+            // Ã¯Â¿Â½ertrag durchs Aufrunden
             { mspref(y_mantMSDptr,0) = bit(intDsize-1); // Mantisse := 10...0
               (TheLfloat(y)->expo)++; // Exponenten incrementieren
         }   }