Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / complex / carg.c
blobf7efb40bdfdf0b6d76f3b686eb0a10ba09cbac2c
1 /* $NetBSD: carg.c,v 1.1 2007/08/20 16:01:31 drochner 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 <<carg>>, <<cargf>>---argument (phase angle)
15 INDEX
16 carg
17 INDEX
18 cargf
20 SYNOPSIS
21 #include <complex.h>
22 double carg(double complex <[z]>);
23 float cargf(float complex <[z]>);
26 DESCRIPTION
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>>.
33 RETURNS
34 @ifnottex
35 The carg functions return the value of the argument in the
36 interval [-pi, +pi]
37 @end ifnottex
38 @tex
39 The carg functions return the value of the argument in the
40 interval [$-\pi$, $+\pi$]
41 @end tex
43 PORTABILITY
44 <<carg>> and <<cargf>> are ISO C99
46 QUICKREF
47 <<carg>> and <<cargf>> are ISO C99
51 #include <complex.h>
52 #include <math.h>
54 double
55 carg(double complex z)
58 return atan2( cimag(z) , creal(z) );