]> www.ginac.de Git - cln.git/blobdiff - src/float/dfloat/elem/cl_DF_from_I.cc
Finalize CLN 1.3.7 release.
[cln.git] / src / float / dfloat / elem / cl_DF_from_I.cc
index d07225b68e789e8a46944577491f4050710644e4..dddaa4473cd36f726da758db3fab9480ca6da755 100644 (file)
@@ -1,18 +1,18 @@
 // cl_I_to_DF().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_DF.h"
+#include "float/dfloat/cl_DF.h"
 
 
 // Implementation.
 
 #include "cln/integer.h"
-#include "cl_I.h"
-#include "cl_DS.h"
-#include "cl_F.h"
+#include "integer/cl_I.h"
+#include "base/digitseq/cl_DS.h"
+#include "float/cl_F.h"
 
 namespace cln {
 
@@ -23,7 +23,7 @@ const cl_DF cl_I_to_DF (const cl_I& x)
 // Merke Vorzeichen von x.
 // x:=(abs x)
 // Exponent:=(integer-length x)
-//   Greife die 54 höchstwertigen Bits heraus (angeführt von einer 1).
+//   Greife die 54 höchstwertigen Bits heraus (angeführt von einer 1).
 //   Runde das letzte Bit weg:
 //     Bit 0 = 0 -> abrunden,
 //     Bit 0 = 1 und Rest =0 -> round-to-even,
@@ -38,9 +38,9 @@ const cl_DF cl_I_to_DF (const cl_I& x)
       // NDS zu |x|>0 bilden:
       var const uintD* MSDptr;
       var uintC len;
-      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,cl_false,);
+      I_to_NDS_nocopy(abs_x, MSDptr=,len=,,false,);
       // MSDptr/len/LSDptr ist die NDS zu x, len>0.
-      // Führende Digits holen: Brauche DF_mant_len+1 Bits, dazu intDsize
+      // Führende Digits holen: Brauche DF_mant_len+1 Bits, dazu intDsize
       // Bits (die NDS kann mit bis zu intDsize Nullbits anfangen).
       // Dann werden diese Bits um (exp mod intDsize) nach rechts geschoben.
       var uintD msd = msprefnext(MSDptr); // erstes Digit
@@ -71,15 +71,15 @@ const cl_DF cl_I_to_DF (const cl_I& x)
       --len; ok:
       #if (cl_word_size==64)
       // Die NDS besteht aus msd, msdd und len weiteren Digits.
-      // Das höchste in 2^64*msd+msdd gesetzte Bit ist Bit Nummer
+      // Das höchste in 2^64*msd+msdd gesetzte Bit ist Bit Nummer
       // 63 + (exp mod intDsize).
       var uintL shiftcount = exp % intDsize;
-      var uint64 mant = // führende 64 Bits
+      var uint64 mant = // führende 64 Bits
         (shiftcount==0
           ? msdd
           : (((uint64)msd << (64-shiftcount)) | (msdd >> shiftcount))
         );
-      // Das höchste in mant gesetzte Bit ist Bit Nummer 63.
+      // Das höchste in mant gesetzte Bit ist Bit Nummer 63.
       if ( ((mant & bit(62-DF_mant_len)) ==0) // Bit 10 =0 -> abrunden
            || ( ((mant & (bit(62-DF_mant_len)-1)) ==0) // Bit 10 =1 und Bits 9..0 =0
                 && ((msdd & (bit(shiftcount)-1)) ==0) // und weitere Bits aus msddf =0
@@ -96,21 +96,21 @@ const cl_DF cl_I_to_DF (const cl_I& x)
           if (mant >= bit(DF_mant_len+1)) // rounding overflow?
             { mant = mant>>1; exp = exp+1; }
         }
-      return encode_DF(sign,(sintL)exp,mant);
+      return encode_DF(sign,(sintE)exp,mant);
       #else
       // Die NDS besteht aus msd, msdd, msddf und len weiteren Digits.
-      // Das höchste in 2^64*msd+2^32*msdd+msddf gesetzte Bit ist Bit Nummer
+      // Das höchste in 2^64*msd+2^32*msdd+msddf gesetzte Bit ist Bit Nummer
       // 63 + (exp mod intDsize).
       var uintL shiftcount = exp % intDsize;
-      var uint32 manthi; // führende 32 Bits
-      var uint32 mantlo; // nächste 32 Bits
+      var uint32 manthi; // führende 32 Bits
+      var uint32 mantlo; // nächste 32 Bits
       if (shiftcount==0)
         { manthi = msdd; mantlo = msddf; }
         else
         { manthi = ((uint32)msd << (32-shiftcount)) | (msdd >> shiftcount);
           mantlo = (msdd << (32-shiftcount)) | (msddf >> shiftcount);
         }
-      // Das höchste in mant gesetzte Bit ist Bit Nummer 63.
+      // Das höchste in mant gesetzte Bit ist Bit Nummer 63.
       if ( ((mantlo & bit(62-DF_mant_len)) ==0) // Bit 10 =0 -> abrunden
            || ( ((mantlo & (bit(62-DF_mant_len)-1)) ==0) // Bit 10 =1 und Bits 9..0 =0
                 && ((msddf & (bit(shiftcount)-1)) ==0) // und weitere Bits aus msddf =0
@@ -132,7 +132,7 @@ const cl_DF cl_I_to_DF (const cl_I& x)
               if (manthi >= bit(DF_mant_len-32+1)) // rounding overflow?
                 { manthi = manthi>>1; exp = exp+1; }
         }   }
-      return encode_DF(sign,(sintL)exp,manthi,mantlo);
+      return encode_DF(sign,(sintE)exp,manthi,mantlo);
       #endif
 }