diff options
Diffstat (limited to 'libc-top-half/musl/src/complex/clog.c')
-rw-r--r-- | libc-top-half/musl/src/complex/clog.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/complex/clog.c b/libc-top-half/musl/src/complex/clog.c new file mode 100644 index 0000000..b587c29 --- /dev/null +++ b/libc-top-half/musl/src/complex/clog.c @@ -0,0 +1,14 @@ +#include "complex_impl.h" + +// FIXME + +/* log(z) = log(|z|) + i arg(z) */ + +double complex clog(double complex z) +{ + double r, phi; + + r = cabs(z); + phi = carg(z); + return CMPLX(log(r), phi); +} |