1 /* $NetBSD: carg.c,v 1.1 2007/08/20 16:01:31 drochner 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 <<carg>>, <<cargf>>---argument (phase angle)
22 double carg(double complex <[z]>);
23 float cargf(float complex <[z]>);
27 These functions compute the argument (also called phase angle)
28 of <[z]>, with a branch cut along the negative real axis.
30 <<cargf>> is identical to <<carg>>, except that it performs
31 its calculations on <<floats complex>>.
35 The carg functions return the value of the argument in the
39 The carg functions return the value of the argument in the
40 interval [$-\pi$, $+\pi$]
44 <<carg>> and <<cargf>> are ISO C99
47 <<carg>> and <<cargf>> are ISO C99
55 carg(double complex z
)
58 return atan2( cimag(z
) , creal(z
) );