summaryrefslogtreecommitdiff
path: root/lib/libm/clog10l.c
blob: cd4ddcb824fa2a63838012151afc4e163f12d723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <complex.h> // for complex, cabsl, cimagl, creall, I
#include <math.h>    // for atan2l, log10l

long double complex clog10l(long double complex z)
{
	long double p, rr;
	rr = cabsl(z);
	p = log10l(rr);
	rr = atan2l(cimagl(z), creall(z)) *
	     0.43429448190325182765112891891660508229439700580366656611445378316586464920887L;
	return p + rr * (long double complex)I;
}