7 #include "cln/rational.h"
13 #include "cln/integer.h"
17 cl_boolean rootp (const cl_RA& x, uintL n, cl_RA* w)
20 // Bei Integers: klar.
21 // Bei Brüchen a/b : muß a=c^n und b=d^n sein. Dann ist die Wurzel = c/d
22 // (mit ggT(c,d)=1 und d>1).
25 return rootp(x,n,(cl_I*)w);
29 var const cl_I& b = denominator(x);
31 if (!rootp(b,n,&d)) // Nenner auf n-te Potenz testen
33 var const cl_I& a = numerator(x);
35 if (!rootp(a,n,&c)) // Zähler auf n-te Potenz testen
37 // beides n-te Potenzen -> Quotient der Wurzeln bilden
38 *w = I_I_to_RT(c,d); return cl_true;