]> www.ginac.de Git - cln.git/blobdiff - src/float/dfloat/conv/cl_RA_to_double.cc
Remove exception hooks in favor of real C++ exceptions:
[cln.git] / src / float / dfloat / conv / cl_RA_to_double.cc
index 904b819a754dfda12beadffd0c1ef6ea7a23c492..373702dc73fa8d23e27e798855f7b0243e66d4ed 100644 (file)
@@ -1,26 +1,28 @@
-// cl_double_approx().
+// double_approx().
 
 // General includes.
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_rational.h"
+#include "cln/rational.h"
 
 
 // Implementation.
 
 #include "cl_DF.h"
 #include "cl_RA.h"
-#include "cl_integer.h"
+#include "cln/integer.h"
 #include "cl_I.h"
 #include "cl_F.h"
 
-double cl_double_approx (const cl_RA& x)
+namespace cln {
+
+double double_approx (const cl_RA& x)
 {
 // Method: same as cl_RA_to_DF().
       if (integerp(x)) {
         DeclareType(cl_I,x);
-        return cl_double_approx(x);
+        return double_approx(x);
       }
  {    // x Ratio
       DeclareType(cl_RT,x);
@@ -29,8 +31,8 @@ double cl_double_approx (const cl_RA& x)
       var const cl_I& b = denominator(x); // b
       var cl_signean sign = -(cl_signean)minusp(a); // Vorzeichen
       if (!(sign==0)) { a = -a; } // Betrag nehmen, liefert a
-      var sintL lendiff = (sintL)integer_length(a) // (integer-length a)
-                          - (sintL)integer_length(b); // (integer-length b)
+      var sintC lendiff = (sintC)integer_length(a) // (integer-length a)
+                          - (sintC)integer_length(b); // (integer-length b)
       if (lendiff > DF_exp_high-DF_exp_mid) // Exponent >= n-m > Obergrenze ?
         {
           #if (cl_word_size==64)
@@ -184,3 +186,5 @@ double cl_double_approx (const cl_RA& x)
       return u.machine_double;
       #endif
 }}
+
+}  // namespace cln