7 #include "cl_rational.h"
13 #include "cl_integer.h"
15 const cl_I ceiling1 (const cl_RA& x, const cl_RA& y)
18 // x = a/b, y = c/d -> liefere (ceiling (* a d) (* b c)).
19 // x Integer -> dito mit b=1.
20 // y Integer -> dito mit d=1.
21 // x und y Integer -> bekannt.
29 var const cl_I& c = numerator(y);
30 var const cl_I& d = denominator(y);
31 return ceiling1(x*d,c);
35 var const cl_I& a = numerator(x);
36 var const cl_I& b = denominator(x);
39 return ceiling1(a,b*y);
42 var const cl_I& c = numerator(y);
43 var const cl_I& d = denominator(y);
44 return ceiling1(a*d,b*c);