]> www.ginac.de Git - cln.git/blob - src/float/dfloat/misc/cl_DF_abs.cc
8a2f725b1e4a24397fd4a1c1f4f2e6623694b302
[cln.git] / src / float / dfloat / misc / cl_DF_abs.cc
1 // abs().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/dfloat.h"
8
9
10 // Implementation.
11
12 #include "cl_inline.h"
13 #include "cl_DF_minusp.cc"
14
15 namespace cln {
16
17 const cl_DF CL_FLATTEN abs (const cl_DF& x)
18 {
19 // x<0 -> (- x), x>=0 -> x
20         if (minusp(x)) return -x; else return x;
21 }
22
23 }  // namespace cln