Importing cargl.c from NetBSD.

This commit is contained in:
Aditya Upadhyay 2017-06-29 01:30:47 +05:30 committed by Corinna Vinschen
parent 436bf2929c
commit 3f1f3a2299
2 changed files with 19 additions and 1 deletions

View File

@ -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 \

18
newlib/libm/complex/cargl.c Executable file
View File

@ -0,0 +1,18 @@
/* $NetBSD: cargl.c,v 1.1 2014/10/10 00:48:18 christos Exp $ */
/*
* Public domain.
*/
#include <complex.h>
#include <math.h>
long double
cargl(long double complex z)
{
#ifdef _LDBL_EQ_DBL
return carg (z);
#else
return atan2l (imag (z), real (z));
#endif
}