7 #include "cln/integer.h"
17 // Falls x=0 oder x=1: x = x^n -> JA, x als Ergebnis.
18 // Hier also x>1. Suche ein Integer y > 1 mit x=y^n.
19 // Falls n >= integer_length(x): NEIN. (Da y>=2, müßte x>=2^n gelten.)
20 // Hier also n>0 klein...
22 cl_boolean rootp (const cl_I& x, const cl_I& n, cl_I* w)
24 if (eq(x,0) || eq(x,1)) // x=0 oder x=1 ?
25 { *w = x; return cl_true; } // ja -> x als Ergebnis
26 if (n >= UL_to_I(integer_length(x)))
28 // Nun ist n < (integer-length x). Also paßt n in ein uintL.
29 return cl_rootp_aux(x,cl_I_to_UL(n),w);