diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am index c70726e42..48b6d92ab 100644 --- a/newlib/libm/complex/Makefile.am +++ b/newlib/libm/complex/Makefile.am @@ -11,7 +11,7 @@ src = cabs.c cacos.c cacosh.c carg.c casin.c casinh.c \ csin.c csinh.c csqrt.c ctan.c ctanh.c lsrc = cabsl.c creall.c cimagl.c ccoshl.c cacoshl.c \ - clogl.c csqrtl.c + clogl.c csqrtl.c cargl.c fsrc = cabsf.c casinf.c ccosf.c cimagf.c cprojf.c \ csqrtf.c cacosf.c casinhf.c ccoshf.c clogf.c clog10f.c \ diff --git a/newlib/libm/complex/cargl.c b/newlib/libm/complex/cargl.c new file mode 100755 index 000000000..d2885a459 --- /dev/null +++ b/newlib/libm/complex/cargl.c @@ -0,0 +1,18 @@ +/* $NetBSD: cargl.c,v 1.1 2014/10/10 00:48:18 christos Exp $ */ + +/* + * Public domain. + */ + +#include +#include + +long double +cargl(long double complex z) +{ + #ifdef _LDBL_EQ_DBL + return carg (z); + #else + return atan2l (imag (z), real (z)); + #endif +}