]> www.ginac.de Git - cln.git/blobdiff - src/float/lfloat/cl_LF.h
Make the long-float overflow check work on 64-bit platforms.
[cln.git] / src / float / lfloat / cl_LF.h
index a68285743239181d6a21ce569b16c949475a16bb..8da8d4013a9749d9ee46b69a0a04f31b3f733f0f 100644 (file)
@@ -3,9 +3,11 @@
 #ifndef _CL_LF_H
 #define _CL_LF_H
 
-#include "cl_number.h"
-#include "cl_lfloat_class.h"
-#include "cl_integer_class.h"
+#include "cln/number.h"
+#include "cln/lfloat_class.h"
+#include "cln/integer_class.h"
+
+namespace cln {
 
 struct cl_heap_lfloat : cl_heap {
        unsigned int len;       // length of mantissa (in digits)
@@ -18,9 +20,11 @@ struct cl_heap_lfloat : cl_heap {
 // so that a LF has not fewer mantissa bits than a DF.
   #define LF_minlen  ceiling(53,intDsize)
 // Exponent.
+// Define as 'unsigned int', not 'unsigned long', so that
+// LF_exp_high+1 wraps around to 0 just like the 'expo' field does.
   #define LF_exp_low  1
-  #define LF_exp_mid  0x80000000UL
-  #define LF_exp_high 0xFFFFFFFFUL
+  #define LF_exp_mid  0x80000000U
+  #define LF_exp_high 0xFFFFFFFFU
 
 inline cl_heap_lfloat* TheLfloat (cl_heap_lfloat* p)
        { return p; }
@@ -137,4 +141,6 @@ extern const cl_LF cl_LF_shortenrelative (const cl_LF& x, const cl_LF& y);
 // 1 ulp(x) < y. y must be >0.
 extern const cl_LF cl_LF_shortenwith (const cl_LF& x, const cl_LF& y);
 
+}  // namespace cln
+
 #endif /* _CL_LF_H */