This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Importing cargl.c from NetBSD.


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3f1f3a2299e852b24000021d7fe3b2be69450e99

commit 3f1f3a2299e852b24000021d7fe3b2be69450e99
Author: Aditya Upadhyay <aadit0402@gmail.com>
Date:   Thu Jun 29 01:30:47 2017 +0530

    Importing cargl.c from NetBSD.

Diff:
---
 newlib/libm/complex/Makefile.am |  2 +-
 newlib/libm/complex/cargl.c     | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/newlib/libm/complex/Makefile.am b/newlib/libm/complex/Makefile.am
index c70726e..48b6d92 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 0000000..d2885a4
--- /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
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]