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