Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Upadhyay <aadit0402@gmail.com>2017-06-28 23:00:47 +0300
committerCorinna Vinschen <corinna@vinschen.de>2017-06-29 14:44:31 +0300
commit3f1f3a2299e852b24000021d7fe3b2be69450e99 (patch)
treebea6bbf32808350d792818a2fa8dacb3a88313fc /newlib/libm/complex
parent436bf2929c579c70a981b7153d2fd269bcf3d86a (diff)
Importing cargl.c from NetBSD.
Diffstat (limited to 'newlib/libm/complex')
-rw-r--r--newlib/libm/complex/Makefile.am2
-rwxr-xr-xnewlib/libm/complex/cargl.c18
2 files changed, 19 insertions, 1 deletions
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 <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
+}