Main index | Section 3 | Options |

Math Library (libm, -lm)

#include <complex.h>

Let
a, +, b, *, Em, idenote the complex number
z.

The
`creal()`
functions return the real part
a,
and the
`cimag()`
functions return the imaginary part
b.

The
`conj()`
functions return the complex conjugate
a, -, b, *, Em, i.

The
`cproj()`
functions return the projection onto the Riemann sphere.
If
z
contains an infinite component, then the result is
∞, ±, 0, Ns, *, Ns, Em, i,
where the (zero) imaginary part of the result has the same sign as
b.
Otherwise, the result is
z.

These functions do not signal any floating point exceptions.

The
`cimag()`,
`conj()`,
`cproj()`,
and
`creal()`
functions conform to
ISO/IEC 9899:1999 ("ISO C99").

The
`cimag()`,
`conj()`
and
`creal()`
functions first appeared in
FreeBSD 5.3 .
The
`cproj()`
functions appeared in
FreeBSD 8.0 .

CIMAG (3) | August 7, 2008 |

Main index | Section 3 | Options |

Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

“ | As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs. | ” |

— Maurice Wilkes |