]> www.ginac.de Git - cln.git/blob - src/rational/division/cl_RA_floor1.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / rational / division / cl_RA_floor1.cc
1 // floor1().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/rational.h"
8
9
10 // Implementation.
11
12 #include "cl_RA.h"
13 #include "cln/integer.h"
14
15 namespace cln {
16
17 const cl_I floor1 (const cl_RA& x)
18 {
19 // Methode:
20 // x Integer -> q := x
21 // x Ratio a/b -> (floor a b)
22         if (integerp(x)) {
23                 DeclareType(cl_I,x);
24                 return x;
25         } else {
26                 DeclareType(cl_RT,x);
27                 var const cl_I& a = numerator(x);
28                 var const cl_I& b = denominator(x);
29                 return floor1(a,b);
30         }
31 }
32
33 }  // namespace cln