Name

conj

Synopsis

Obtains the conjugate of a complex number

#include <complex.h>
double complexconj( double complex z );
float complex conjf( float complex z );
long double complex conjl( long double complex z );

The conj() function returns the complex conjugate of its complex argument. The conjugate of a complex number x + yi, where x and y are the real and imaginary parts, is defined as xyi. Accordingly, the conj() function calculates the conjugate by changing the sign of the imaginary part.

Example

See the example for cabs() in this chapter.

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.