summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/src/w_cabsl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/msun/src/w_cabsl.c b/lib/msun/src/w_cabsl.c
new file mode 100644
index 0000000..b715e0c
--- /dev/null
+++ b/lib/msun/src/w_cabsl.c
@@ -0,0 +1,20 @@
+/*
+ * cabs() wrapper for hypot().
+ *
+ * Written by J.T. Conklin, <jtc@wimsey.com>
+ * Placed into the Public Domain, 1994.
+ *
+ * Modified by Steven G. Kargl for the long double type.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <complex.h>
+#include <math.h>
+
+long double
+cabsl(long double complex z)
+{
+ return hypotl(creall(z), cimagl(z));
+}
OpenPOWER on IntegriCloud