aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schultz <das@FreeBSD.org>2008-03-30 20:02:03 +0000
committerDavid Schultz <das@FreeBSD.org>2008-03-30 20:02:03 +0000
commit2264157a42d28b86c281337cfd84c3155ec14bc1 (patch)
tree233e4392d36fc0104a37f5916428afdec0bb4499
parentd23166b0152645e2d26b3a27cb9d164a39091833 (diff)
downloadsrc-2264157a42d28b86c281337cfd84c3155ec14bc1.tar.gz
src-2264157a42d28b86c281337cfd84c3155ec14bc1.zip
Implement cabsl() in terms of hypotl().
Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>
Notes
Notes: svn path=/head/; revision=177757
-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 000000000000..b715e0c340d8
--- /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));
+}