1 /* $NetBSD: cimag.c,v 1.2 2010/09/15 16:11:29 christos Exp $ */
4 * Written by Matthias Drochner <drochner@NetBSD.org>.
7 * imported and modified include for newlib 2010/10/03
8 * Marco Atzeri <marco_atzeri@yahoo.it>
13 <<cimag>>, <<cimagf>>, <<cimagl>>---imaginary part
24 double cimag(double complex <[z]>);
25 float cimagf(float complex <[z]>);
26 long double cimagl(long double complex <[z]>);
30 These functions compute the imaginary part of <[z]>.
32 <<cimagf>> is identical to <<cimag>>, except that it performs
33 its calculations on <<float complex>>.
35 <<cimagl>> is identical to <<cimag>>, except that it performs
36 its calculations on <<long double complex>>.
39 The cimag* functions return the imaginary part value (as a real).
42 <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99
45 <<cimag>>, <<cimagf>> and <<cimagl>> are ISO C99
51 #include "../common/fdlibm.h"
54 cimag(double complex z
)
56 double_complex w
= { .z
= z
};
58 return (IMAG_PART(w
));