From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/c/numeric%2Fcomplex%2Fconj.html | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 devdocs/c/numeric%2Fcomplex%2Fconj.html (limited to 'devdocs/c/numeric%2Fcomplex%2Fconj.html') diff --git a/devdocs/c/numeric%2Fcomplex%2Fconj.html b/devdocs/c/numeric%2Fcomplex%2Fconj.html new file mode 100644 index 00000000..f59d1427 --- /dev/null +++ b/devdocs/c/numeric%2Fcomplex%2Fconj.html @@ -0,0 +1,43 @@ +

conjf, conj, conjl

Defined in header <complex.h>
float complex       conjf( float complex z );
+
(1) (since C99)
double complex      conj( double complex z );
+
(2) (since C99)
long double complex conjl( long double complex z );
+
(3) (since C99)
Defined in header <tgmath.h>
#define conj( z )
+
(4) (since C99)
+1-3) Computes the complex conjugate of z by reversing the sign of the imaginary part.
+4) Type-generic macro: if z has type long double complex, long double imaginary, or long double, conjl is called. If z has type float complex, float imaginary, or float, conjf is called. If z has type double complex, double imaginary, double, or any integer type, conj is called.

Parameters

+ +
z - complex argument

Return value

The complex conjugate of z.

+

Notes

On C99 implementations that do not implement I as _Imaginary_I, conj may be used to obtain complex numbers with negative zero imaginary part. In C11, the macro CMPLX is used for that purpose.

+

Example

#include <stdio.h>
+#include <complex.h>
+ 
+int main(void)
+{
+    double complex z = 1.0 + 2.0*I;
+    double complex z2 = conj(z);
+    printf("The conjugate of %.1f%+.1fi is %.1f%+.1fi\n",
+            creal(z), cimag(z), creal(z2), cimag(z2));
+ 
+    printf("Their product is %.1f%+.1fi\n", creal(z*z2), cimag(z*z2));
+}

Output:

+
The conjugate of 1.0+2.0i is 1.0-2.0i
+Their product is 5.0+0.0i

References

See also

+
C++ documentation for conj
+

+ © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
+ https://en.cppreference.com/w/c/numeric/complex/conj +

+
-- cgit v1.2.3