]> www.ginac.de Git - cln.git/blob - src/rational/misc/cl_RA_expt.cc
Remove internal inline versions of numerator/denominator(cl_RA).
[cln.git] / src / rational / misc / cl_RA_expt.cc
1 // expt().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/rational.h"
8
9
10 // Implementation.
11
12 namespace cln {
13
14 const cl_RA expt (const cl_RA& x, sintL y)
15 {
16 // Methode:
17 // Für y>0: klar.
18 // Für y=0: Ergebnis 1.
19 // Für y<0: (/ (expt x (- y))).
20         if (y > 0)
21                 return expt_pos(x,(uintL)y);
22         elif (y == 0)
23                 return 1;
24         else // y < 0
25                 return recip(expt_pos(x,(uintL)(-y)));
26 }
27
28 }  // namespace cln