]> www.ginac.de Git - cln.git/blobdiff - src/rational/algebraic/cl_RA_sqrtp.cc
Replace unused macro with cl_unused.
[cln.git] / src / rational / algebraic / cl_RA_sqrtp.cc
index d49cb995d2d72298c1ed9ec694b8b997bf035e8a..bf3956b33c384d63cec93583a5a333a2182b1869 100644 (file)
@@ -1,22 +1,24 @@
 // sqrtp().
 
 // General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
 
 // Specification.
-#include "cl_rational.h"
+#include "cln/rational.h"
 
 
 // Implementation.
 
-#include "cl_RA.h"
-#include "cl_integer.h"
+#include "rational/cl_RA.h"
+#include "cln/integer.h"
 
-cl_boolean sqrtp (const cl_RA& x, cl_RA* w)
+namespace cln {
+
+bool sqrtp (const cl_RA& x, cl_RA* w)
 {
 // Methode:
 // Bei Integers: klar.
-// Bei Brüchen a/b : muß a=c^2 und b=d^2 sein. Dann ist die Wurzel = c/d
+// Bei Brüchen a/b : muß a=c^2 und b=d^2 sein. Dann ist die Wurzel = c/d
 // (mit ggT(c,d)=1 und d>1).
        if (integerp(x)) {
                DeclareType(cl_I,x);
@@ -27,11 +29,13 @@ cl_boolean sqrtp (const cl_RA& x, cl_RA* w)
        var const cl_I& b = denominator(x);
        var cl_I d;
        if (!sqrtp(b,&d)) // Nenner auf Quadratzahl testen
-               return cl_false;
+               return false;
        var const cl_I& a = numerator(x);
        var cl_I c;
-       if (!sqrtp(a,&c)) // Zähler auf Quadratzahl testen
-               return cl_false;
+       if (!sqrtp(a,&c)) // Zähler auf Quadratzahl testen
+               return false;
        // beides Quadratzahlen -> Quotient der Wurzeln bilden
-       *w = I_I_to_RT(c,d); return cl_true;
+       *w = I_I_to_RT(c,d); return true;
 }}
+
+}  // namespace cln