summaryrefslogtreecommitdiff
path: root/lib/libm/src
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1994-03-01 17:14:34 +0000
committerjtc <jtc@NetBSD.org>1994-03-01 17:14:34 +0000
commitefcdc02b304e04a1583e61a72d57344fd72aaa06 (patch)
tree1b32586cfb3a486e035a02afae2523d890bb4ea5 /lib/libm/src
parent10c02ec354435b69d4ab9b37b901a9fec9a31f9e (diff)
Add cabs() & drem() for BSD libm compatibility.
Diffstat (limited to 'lib/libm/src')
-rw-r--r--lib/libm/src/w_cabs.c20
-rw-r--r--lib/libm/src/w_drem.c15
2 files changed, 35 insertions, 0 deletions
diff --git a/lib/libm/src/w_cabs.c b/lib/libm/src/w_cabs.c
new file mode 100644
index 00000000000..f55a2dde8e0
--- /dev/null
+++ b/lib/libm/src/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);
+}
diff --git a/lib/libm/src/w_drem.c b/lib/libm/src/w_drem.c
new file mode 100644
index 00000000000..7f504934038
--- /dev/null
+++ b/lib/libm/src/w_drem.c
@@ -0,0 +1,15 @@
+/*
+ * drem() wrapper for remainder().
+ *
+ * Written by J.T. Conklin, <jtc@wimsey.com>
+ * Placed into the Public Domain, 1994.
+ */
+
+#include <math.h>
+
+double
+drem(x, y)
+ double x, y;
+{
+ return remainder(x, y);
+}