]> www.ginac.de Git - cln.git/blob - src/float/misc/cl_F_abs.cc
* Also filter out SCCS subdirs while recursing and searching for
[cln.git] / src / float / misc / cl_F_abs.cc
1 // abs().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/float.h"
8
9
10 // Implementation.
11
12 #include "cl_F.h"
13 #include "cln/sfloat.h"
14 #include "cln/ffloat.h"
15 #include "cln/dfloat.h"
16 #include "cln/lfloat.h"
17
18 #undef MAYBE_INLINE
19 #define MAYBE_INLINE inline
20 #include "cl_SF_minusp.cc"
21 #include "cl_FF_minusp.cc"
22 #include "cl_DF_minusp.cc"
23 #include "cl_LF_minusp.cc"
24
25 namespace cln {
26
27 const cl_F abs (const cl_F& x)
28 {
29 // x<0 -> (- x), x>=0 -> x
30         floatcase(x
31         ,       if (minusp(x)) return -x; else return x;
32         ,       if (minusp(x)) return -x; else return x;
33         ,       if (minusp(x)) return -x; else return x;
34         ,       if (minusp(x)) return -x; else return x;
35         );
36 }
37
38 }  // namespace cln