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