summaryrefslogtreecommitdiff
path: root/newlib/libm/mathfp/w_cabs.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libm/mathfp/w_cabs.c')
-rw-r--r--newlib/libm/mathfp/w_cabs.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/newlib/libm/mathfp/w_cabs.c b/newlib/libm/mathfp/w_cabs.c
new file mode 100644
index 00000000000..bef76680c06
--- /dev/null
+++ b/newlib/libm/mathfp/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 "fdlibm.h"
+
+struct complex {
+ double x;
+ double y;
+};
+
+double
+cabs(z)
+ struct complex z;
+{
+ return hypot(z.x, z.y);
+}