]> www.ginac.de Git - cln.git/blob - src/integer/misc/cl_I_signum.cc
Don't generate cln.texi from cln.tex any more.
[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 MAYBE_INLINE
17 const cl_I signum (const cl_I& x)
18 {
19         if (minusp(x)) { return -1; } // x<0 -> -1
20         elif (zerop(x)) { return 0; } // x=0 -> 0
21         else { return 1; } // x>0 -> +1
22 }
23
24 }  // namespace cln