]> www.ginac.de Git - cln.git/blob - src/integer/misc/cl_I_signum.cc
Fix linking problems on some platforms caused by inline/non-inline versions
[cln.git] / src / integer / misc / cl_I_signum.cc
1 // signum().
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 CL_INLINE const cl_I CL_INLINE_DECL(signum) (const cl_I& x)
17 {
18         if (minusp(x)) { return -1; } // x<0 -> -1
19         elif (zerop(x)) { return 0; } // x=0 -> 0
20         else { return 1; } // x>0 -> +1
21 }
22
23 }  // namespace cln