]> www.ginac.de Git - cln.git/blobdiff - src/float/lfloat/elem/cl_LF_from_I.cc
Extend the exponent range from 32 bits to 64 bits on selected platforms.
[cln.git] / src / float / lfloat / elem / cl_LF_from_I.cc
index 7b9ba79667e00ddcf75bb9fa18acad5dc6207197..c18e3298c8e7e3ef6a058fd4153ff3880884cc69 100644 (file)
@@ -36,14 +36,14 @@ const cl_LF cl_I_to_LF (const cl_I& x, uintC len)
       if (eq(x,0)) { return encode_LF0(len); } // x=0 -> Ergebnis 0.0
       var cl_signean sign = -(cl_signean)minusp(x); // Vorzeichen von x
       var cl_I abs_x = (sign==0 ? x : -x);
-      var uintL exp = integer_length(abs_x); // (integer-length x) < intDsize*2^intCsize
+      var uintC exp = integer_length(abs_x); // (integer-length x) < intDsize*2^intCsize
       // Teste, ob exp <= LF_exp_high-LF_exp_mid :
       if (   (log2_intDsize+intCsize < 32)
-          && ((uintL)(intDsize*bitc(intCsize)-1) <= (uintL)(LF_exp_high-LF_exp_mid))
+          && ((uintE)(intDsize*bitc(intCsize)-1) <= (uintE)(LF_exp_high-LF_exp_mid))
          )
         {} // garantiert exp <= intDsize*2^intCsize-1 <= LF_exp_high-LF_exp_mid
         else
-        { if (!(exp <= (uintL)(LF_exp_high-LF_exp_mid))) { cl_error_floating_point_overflow(); } }
+        { if (!(exp <= (uintE)(LF_exp_high-LF_exp_mid))) { cl_error_floating_point_overflow(); } }
       // Long-Float bauen:
       var Lfloat y = allocate_lfloat(len,exp+LF_exp_mid,sign);
       var uintD* y_mantMSDptr = arrayMSDptr(TheLfloat(y)->data,len);
@@ -91,7 +91,7 @@ const cl_LF cl_I_to_LF (const cl_I& x, uintC len)
                { mspref(y_mantMSDptr,0) = bit(intDsize-1); // Mantisse := 10...0
                  // Exponenten incrementieren:
                  if (   (log2_intDsize+intCsize < 32)
-                     && ((uintL)(intDsize*bitc(intCsize)-1) < (uintL)(LF_exp_high-LF_exp_mid))
+                     && ((uintE)(intDsize*bitc(intCsize)-1) < (uintE)(LF_exp_high-LF_exp_mid))
                     )
                    // garantiert exp < intDsize*2^intCsize-1 <= LF_exp_high-LF_exp_mid
                    { (TheLfloat(y)->expo)++; } // jetzt exp <= LF_exp_high-LF_exp_mid