]> www.ginac.de Git - cln.git/blobdiff - src/float/dfloat/cl_DF.h
Finalize CLN 1.3.7 release.
[cln.git] / src / float / dfloat / cl_DF.h
index 701a0b70258401bd08614d5805755ceb3e450788..6951bf23ea38f550322e243f72d7e8ecdbba1b0c 100644 (file)
@@ -5,12 +5,12 @@
 
 #include "cln/number.h"
 #include "cln/malloc.h"
-#include "cl_low.h"
-#include "cl_F.h"
+#include "base/cl_low.h"
+#include "float/cl_F.h"
 
 #ifdef FAST_DOUBLE
-#include "cl_N.h"
-#include "cl_F.h"
+#include "base/cl_N.h"
+#include "float/cl_F.h"
 #endif
 
 namespace cln {
@@ -121,7 +121,7 @@ inline cl_heap_dfloat* allocate_dfloat (uint32 semhi, uint32 mlo)
         { zero_statement } /* e=0 -> Zahl 0.0 */                       \
         else                                                           \
         { exp_zuweisung (sintL)(uexp - DF_exp_mid); /* Exponent */     \
-          unused (sign_zuweisung ((sint64)_x >> 63)); /* Vorzeichen */ \
+          cl_unused (sign_zuweisung ((sint64)_x >> 63)); /* Vorzeichen */      \
           mant_zuweisung (bit(DF_mant_len) | (_x & (bit(DF_mant_len)-1))); \
     }   }
 #else
@@ -142,7 +142,7 @@ inline cl_heap_dfloat* allocate_dfloat (uint32 semhi, uint32 mlo)
         { zero_statement } /* e=0 -> Zahl 0.0 */                       \
         else                                                           \
         { exp_zuweisung (sintL)(uexp - DF_exp_mid); /* Exponent */     \
-          unused (sign_zuweisung sign_of((sint32)(semhi))); /* Vorzeichen */\
+          cl_unused (sign_zuweisung sign_of((sint32)(semhi))); /* Vorzeichen */\
           manthi_zuweisung (bit(DF_mant_len-32) | (semhi & (bit(DF_mant_len-32)-1))); \
           mantlo_zuweisung mlo;                                                \
     }   }
@@ -153,20 +153,20 @@ inline cl_heap_dfloat* allocate_dfloat (uint32 semhi, uint32 mlo)
 // encode_DF(sign,exp,mant)
 // liefert ein Double-Float.
 // > cl_signean sign: Vorzeichen, 0 für +, -1 für negativ.
-// > sintL exp: Exponent
+// > sintE exp: Exponent
 // > uintQ mant: Mantisse, sollte >= 2^DF_mant_len und < 2^(DF_mant_len+1) sein.
 // < cl_DF ergebnis: ein Double-Float
 // Der Exponent wird auf Überlauf/Unterlauf getestet.
-inline const cl_DF encode_DF (cl_signean sign, sintL exp, uintQ mant)
+inline const cl_DF encode_DF (cl_signean sign, sintE exp, uintQ mant)
 {
-      if (exp < (sintL)(DF_exp_low-DF_exp_mid))
+      if (exp < (sintE)(DF_exp_low-DF_exp_mid))
         { if (underflow_allowed())
             { throw floating_point_underflow_exception(); }
             else
             { return cl_DF_0; }
         }
       else
-      if (exp > (sintL)(DF_exp_high-DF_exp_mid))
+      if (exp > (sintE)(DF_exp_high-DF_exp_mid))
         { throw floating_point_overflow_exception(); }
       else
       return allocate_dfloat
@@ -179,21 +179,21 @@ inline const cl_DF encode_DF (cl_signean sign, sintL exp, uintQ mant)
 // encode_DF(sign,exp,manthi,mantlo)
 // liefert ein Double-Float.
 // > cl_signean sign: Vorzeichen, 0 für +, -1 für negativ.
-// > sintL exp: Exponent
+// > sintE exp: Exponent
 // > uintL manthi,mantlo: Mantisse 2^32*manthi+mantlo,
 //                        sollte >= 2^DF_mant_len und < 2^(DF_mant_len+1) sein.
 // < cl_DF ergebnis: ein Double-Float
 // Der Exponent wird auf Überlauf/Unterlauf getestet.
-inline const cl_DF encode_DF (cl_signean sign, sintL exp, uintL manthi, uintL mantlo)
+inline const cl_DF encode_DF (cl_signean sign, sintE exp, uintL manthi, uintL mantlo)
 {
-      if (exp < (sintL)(DF_exp_low-DF_exp_mid))
+      if (exp < (sintE)(DF_exp_low-DF_exp_mid))
         { if (underflow_allowed())
             { throw floating_point_underflow_exception(); }
             else
             { return cl_DF_0; }
         }
       else
-      if (exp > (sintL)(DF_exp_high-DF_exp_mid))
+      if (exp > (sintE)(DF_exp_high-DF_exp_mid))
         { throw floating_point_overflow_exception(); }
       else
       return allocate_dfloat
@@ -309,10 +309,8 @@ extern const cl_DF cl_RA_to_DF (const cl_RA& x);
 //   e=2047, m=0: vorzeichenbehaftete Infinity
 //   e=2047, m/=0: NaN
 
-// cl_double_to_DF(val) wandelt ein IEEE-Double-Float val in ein Double-Float um.
-extern cl_heap_dfloat* cl_double_to_DF_pointer (const dfloatjanus& val);
-inline const cl_DF cl_double_to_DF (const dfloatjanus& val)
-       { return cl_double_to_DF_pointer(val); }
+// cl_double_to_DF_pointer(val) wandelt ein IEEE-Double-Float val in ein Double-Float um.
+extern cl_heap_dfloat* cl_double_to_DF_pointer (const double val);
 
 // cl_DF_to_double(obj,&val);
 // wandelt ein Double-Float obj in ein IEEE-Double-Float val um.