xref: /minix3/lib/libm/complex/creal.c (revision 2fe8fb192fe7e8720e3e7a77f928da545e872a6a)
1*2fe8fb19SBen Gras /* $NetBSD: creal.c,v 1.2 2010/09/15 16:11:29 christos Exp $ */
2*2fe8fb19SBen Gras 
3*2fe8fb19SBen Gras /*
4*2fe8fb19SBen Gras  * Written by Matthias Drochner <drochner@NetBSD.org>.
5*2fe8fb19SBen Gras  * Public domain.
6*2fe8fb19SBen Gras  */
7*2fe8fb19SBen Gras 
8*2fe8fb19SBen Gras #include <complex.h>
9*2fe8fb19SBen Gras #include "../src/math_private.h"
10*2fe8fb19SBen Gras 
11*2fe8fb19SBen Gras double
creal(double complex z)12*2fe8fb19SBen Gras creal(double complex z)
13*2fe8fb19SBen Gras {
14*2fe8fb19SBen Gras 	double_complex w = { .z = z };
15*2fe8fb19SBen Gras 
16*2fe8fb19SBen Gras 	return (REAL_PART(w));
17*2fe8fb19SBen Gras }
18