Cygwin: //: fetch only one item per loop
[newlib-cygwin.git] / newlib / libm / complex / conj.c
blob9e9d278b21e408bbe40f456b5d8982e3644be912
1 /* $NetBSD: conj.c,v 1.2 2010/09/15 16:11:29 christos Exp $ */
3 /*
4 * Written by Matthias Drochner <drochner@NetBSD.org>.
5 * Public domain.
7 * imported and modified include for newlib 2010/10/03
8 * Marco Atzeri <marco_atzeri@yahoo.it>
9 */
12 FUNCTION
13 <<conj>>, <<conjf>>---complex conjugate
15 INDEX
16 conj
17 INDEX
18 conjf
20 SYNOPSIS
21 #include <complex.h>
22 double complex conj(double complex <[z]>);
23 float complex conjf(float complex <[z]>);
26 DESCRIPTION
27 These functions compute the complex conjugate of <[z]>,
28 by reversing the sign of its imaginary part.
30 <<conjf>> is identical to <<conj>>, except that it performs
31 its calculations on <<floats complex>>.
33 RETURNS
34 The conj functions return the complex conjugate value.
36 PORTABILITY
37 <<conj>> and <<conjf>> are ISO C99
39 QUICKREF
40 <<conj>> and <<conjf>> are ISO C99
44 #include <complex.h>
45 #include "../common/fdlibm.h"
47 double complex
48 conj(double complex z)
50 double_complex w = { .z = z };
52 IMAG_PART(w) = -IMAG_PART(w);
54 return (w.z);