]> www.ginac.de Git - cln.git/blob - misc/cl_C_conjugate.cc
Finalize CLN 1.3.7 release.
[cln.git] / misc / cl_C_conjugate.cc
1 // conjugate().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cln/complex.h"
8
9
10 // Implementation.
11
12 #include "cl_C.h"
13 #include "cln/real.h"
14
15 namespace cln {
16
17 const cl_N conjugate (const cl_N& x)
18 {
19         if (realp(x))
20                 return x;
21         else {
22                 DeclareType(cl_C,x);
23                 var const cl_R& a = realpart(x);
24                 var const cl_R& b = imagpart(x);
25                 // Vorzeichenwechsel beim Imaginärteil
26                 return complex_C(a,-b);
27         }
28 }
29
30 }  // namespace cln