7 #include "cln/rational.h"
13 #include "cln/integer.h"
17 const cl_I truncate1 (const cl_RA& x, const cl_RA& y)
20 // x = a/b, y = c/d -> liefere (truncate (* a d) (* b c)).
21 // x Integer -> dito mit b=1.
22 // y Integer -> dito mit d=1.
23 // x und y Integer -> bekannt.
28 return truncate1(x,y);
31 var const cl_I& c = numerator(y);
32 var const cl_I& d = denominator(y);
33 return truncate1(x*d,c);
37 var const cl_I& a = numerator(x);
38 var const cl_I& b = denominator(x);
41 return truncate1(a,b*y);
44 var const cl_I& c = numerator(y);
45 var const cl_I& d = denominator(y);
46 return truncate1(a*d,b*c);