Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / complex / clog10.c
blobf6cf45396f95081f0f1ebeeeae229189efa9eeb8
1 /*
2 FUNCTION
3 <<clog10>>, <<clog10f>>---complex base-10 logarithm
5 INDEX
6 clog10
7 INDEX
8 clog10f
10 SYNOPSIS
11 #define _GNU_SOURCE
12 #include <complex.h>
13 double complex clog10(double complex <[z]>);
14 float complex clog10f(float complex <[z]>);
17 DESCRIPTION
18 These functions compute the complex base-10 logarithm of <[z]>.
19 <<clog10>> is equivalent to <<clog>>(<[z]>)/<<log>>(10).
21 <<clog10f>> is identical to <<clog10>>, except that it performs
22 its calculations on <<floats complex>>.
24 RETURNS
25 The clog10 functions return the complex base-10 logarithm value.
27 PORTABILITY
28 <<clog10>> and <<clog10f>> are GNU extensions.
32 #include <complex.h>
33 #include <math.h>
35 double complex
36 clog10(double complex z)
38 double complex w;
39 double p, rr;
41 rr = cabs(z);
42 p = log10(rr);
43 rr = atan2(cimag(z), creal(z)) * M_IVLN10;
44 w = p + rr * I;
45 return w;