summaryrefslogtreecommitdiff
path: root/libm/w_cabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'libm/w_cabs.c')
-rw-r--r--libm/w_cabs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libm/w_cabs.c b/libm/w_cabs.c
new file mode 100644
index 000000000..f55a2dde8
--- /dev/null
+++ b/libm/w_cabs.c
@@ -0,0 +1,20 @@
+/*
+ * cabs() wrapper for hypot().
+ *
+ * Written by J.T. Conklin, <jtc@wimsey.com>
+ * Placed into the Public Domain, 1994.
+ */
+
+#include <math.h>
+
+struct complex {
+ double x;
+ double y;
+};
+
+double
+cabs(z)
+ struct complex z;
+{
+ return hypot(z.x, z.y);
+}