]> www.ginac.de Git - cln.git/blob - src/rational/elem/cl_RA_from_I_I_div.cc
Use paths relative the `src' directory in the #include directives.
[cln.git] / src / rational / elem / cl_RA_from_I_I_div.cc
1 // I_I_div_RA().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "rational/cl_RA.h"
8
9
10 // Implementation.
11
12 #include "cln/exception.h"
13 #include "integer/cl_I.h"
14
15 namespace cln {
16
17 const cl_RA I_I_div_RA (const cl_I& a, const cl_I& b)
18 {
19 // Methode:
20 // Falls b=0: Error.
21 // Falls b>0: I_posI_div_RA anwenden.
22 // Falls b<0: I_posI_div_RA auf (- a) und (- b) anwenden.
23         if (eq(b,0))
24                 throw division_by_0_exception();
25         if (minusp(b))
26                 return I_posI_div_RA(-a,-b);
27         else
28                 return I_posI_div_RA(a,b);
29 }
30
31 }  // namespace cln