]> www.ginac.de Git - cln.git/blobdiff - src/float/lfloat/elem/cl_LF_fround.cc
2006-04-25 Bruno Haible <bruno@clisp.org>
[cln.git] / src / float / lfloat / elem / cl_LF_fround.cc
index fd8fbcc6ac63d440e605c7150aa0ddbc9582442d..8decf62d8cea6b0bcf1c8a9e1d6d7145e63ad066 100644 (file)
@@ -4,7 +4,7 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_lfloat.h"
+#include "cln/lfloat.h"
 
 
 // Implementation.
@@ -13,6 +13,8 @@
 #include "cl_LF_impl.h"
 #include "cl_DS.h"
 
+namespace cln {
+
 const cl_LF fround (const cl_LF& x)
 {
 // Methode:
@@ -27,7 +29,7 @@ const cl_LF fround (const cl_LF& x)
       var uintC mantlen;
       LF_decode(x, { return x; }, sign=,exp=,mantMSDptr=,mantlen=,);
       if (exp<0) { return encode_LF0(mantlen); } // e<0 -> Ergebnis 0.0
-      if ((uintL)exp >= intDsize*(uintL)mantlen) // e>=16n -> x als Ergebnis
+      if ((uintL)exp >= intDsize*mantlen) // e>=16n -> x als Ergebnis
         { return x; }
         else
         // 0 <= e < 16n
@@ -79,7 +81,7 @@ const cl_LF fround (const cl_LF& x)
           return encode_LF0(len); // e<0 -> Ergebnis 0.0
         }
       var uintL exp = uexp - LF_exp_mid;
-      if (exp >= intDsize*(uintL)len) // e>=16n -> x als Ergebnis
+      if (exp >= intDsize*len) // e>=16n -> x als Ergebnis
         { return x; }
       // 0 <= e < 16n
       // alle hinteren 16n-e Bits wegrunden:
@@ -132,3 +134,5 @@ const cl_LF fround (const cl_LF& x)
         }
 #endif
 }
+
+}  // namespace cln