Namespaces
Variants
Views
Actions

conjf, conj, conjl

From cppreference.com
< c‎ | numeric‎ | complex
Defined in header <complex.h>
float complex       conjf( float complex z );
(since C99)
double complex      conj( double complex z );
(since C99)
long double complex conjl( long double complex z );
(since C99)

Computes the complex conjugate of z by reversing the sign of the imaginary part.

Contents

[edit] Parameters

z - complex argument

[edit] Return value

The complex conjugate of z.

[edit] Example

#include <stdio.h>
#include <complex.h>
 
int main(void)
{ 
    double complex z = conj(1.0 + 2.0*I);
    printf("%f%+fi\n", creal(z), cimag(z));
 
    return 0;
}

Output:

1.000000-2.000000i

[edit] See also