diff options
Diffstat (limited to 'lib/libm/clog10.c')
| -rw-r--r-- | lib/libm/clog10.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libm/clog10.c b/lib/libm/clog10.c new file mode 100644 index 00000000..a1db1663 --- /dev/null +++ b/lib/libm/clog10.c @@ -0,0 +1,11 @@ +#include <math.h> +#include "__complex.h" + +double complex clog10(double complex z) +{ + double p, rr; + rr = cabs(z); + p = log10(rr); + rr = atan2(cimag(z), creal(z)) * M_IVLN10; + return p + rr * (double complex)I; +} |
