]> www.ginac.de Git - cln.git/blob - src/rational/elem/cl_RA_div.cc
* All Files have been modified for inclusion of namespace cln;
[cln.git] / src / rational / elem / cl_RA_div.cc
1 // binary operator /
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_RA operator/ (const cl_RA& r, const cl_RA& s)
18 {
19 // Methode:
20 // (* r (/ s))
21         if (integerp(r) && integerp(s)) {
22                 DeclareType(cl_I,r);
23                 DeclareType(cl_I,s);
24                 // r und s Integers -> schnell abhandeln
25                 return I_I_div_RA(r,s);
26         }
27         return r * recip(s);
28 }
29
30 }  // namespace cln