7 #include "cln/rational.h"
13 #include "cln/integer.h"
17 const cl_RA_div_t round2 (const cl_RA& x)
20 // x Integer -> (q,r) := (x,0)
22 // (round a b) liefert q und r.
23 // Liefere q und r/b (mit b>1 und ggT(r,b)=ggT(r+q*b,b)=ggT(a,b)=1).
27 return cl_RA_div_t(x,0);
30 var const cl_I& a = numerator(x);
31 var const cl_I& b = denominator(x);
32 var cl_I_div_t q_r = round2(a,b);
33 var cl_I& q = q_r.quotient;
34 var cl_I& r = q_r.remainder;
35 return cl_RA_div_t(q,I_I_to_RT(r,b));