]> www.ginac.de Git - cln.git/blob - src/real/division/cl_R_mod.cc
Use paths relative the `src' directory in the #include directives.
[cln.git] / src / real / division / cl_R_mod.cc
1 // mod().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/real.h"
8
9
10 // Implementation.
11
12 #include "real/cl_R.h"
13 #include "cln/integer.h"
14
15 namespace cln {
16
17 const cl_R mod (const cl_R& x, const cl_R& y)
18 {
19 // Methode:
20 // Beides Integers -> mod(x,y).
21 // Sonst: floor2(x/y) -> (q,r). Liefere x-y*q=y*r.
22         if (integerp(x))
23                 if (integerp(y)) {
24                         DeclareType(cl_I,x);
25                         DeclareType(cl_I,y);
26                         return mod(x,y);
27                 }
28         return y * floor2(x/y).remainder;
29 }
30
31 }  // namespace cln