Rich Felker | b69f695 | 2012-03-13 01:17:53 -0400 | [diff] [blame] | 1 | #include "libm.h" |
2 | |||||
3 | // FIXME | ||||
4 | |||||
5 | /* log(z) = log(|z|) + i arg(z) */ | ||||
6 | |||||
7 | double complex clog(double complex z) | ||||
8 | { | ||||
9 | double r, phi; | ||||
10 | |||||
11 | r = cabs(z); | ||||
12 | phi = carg(z); | ||||
Szabolcs Nagy | cfbaba7 | 2012-11-13 01:31:49 +0100 | [diff] [blame] | 13 | return CMPLX(log(r), phi); |
Rich Felker | b69f695 | 2012-03-13 01:17:53 -0400 | [diff] [blame] | 14 | } |