summaryrefslogtreecommitdiff
path: root/lib/libm/cexpl.c
blob: 6a83dd847284af97ffac780f9140a3e3879b200c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <complex.h> // for cexpl, cimagl, complex, creall, I
#include <math.h>    // for cosl, expl, sinl

long double complex cexpl(long double complex z)
{
	long double r, x, y;

	x = creall(z);
	y = cimagl(z);
	r = expl(x);

	return r * cosl(y) + r * sinl(y) * I;
}