1 /* $NetBSD: creal.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 <<creal>>, <<crealf>>, <<creall>>---real part
24 double creal(double complex <[z]>);
25 float crealf(float complex <[z]>);
26 double long creall(long double complex <[z]>);
30 These functions compute the real part of <[z]>.
32 <<crealf>> is identical to <<creal>>, except that it performs
33 its calculations on <<float complex>>.
35 <<creall>> is identical to <<creal>>, except that it performs
36 its calculations on <<long double complex>>.
39 The creal* functions return the real part value.
42 <<creal>>, <<crealf>> and <<creall>> are ISO C99
45 <<creal>>, <<crealf>> and <<creall>> are ISO C99
51 #include "../common/fdlibm.h"
54 creal(double complex z
)
56 double_complex w
= { .z
= z
};
58 return (REAL_PART(w
));