]> www.ginac.de Git - cln.git/blob - src/integer/misc/cl_I_abs.cc
Replace CL_REQUIRE/CL_PROVIDE(cl_C_ring) with portable code.
[cln.git] / src / integer / misc / cl_I_abs.cc
1 // abs().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/integer.h"
8
9
10 // Implementation.
11
12 #include "cl_I.h"
13
14 namespace cln {
15
16 const cl_I abs (const cl_I& x)
17 {
18         // Methode:
19         // Bei x<0: (- x), sonst x.
20         if (minusp(x))
21                 return -x;
22         else
23                 return x;
24 }
25
26 }  // namespace cln