aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2002-06-10 23:26:57 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2002-06-10 23:26:57 +0000
commitfb2156b6a89f5096eef74f126ca8545fbd0512db (patch)
tree9d332ba7c360925f29ecf6db9a7e633942967dc0
parenta499215e4eac78bfc096cd480fc3db9454bd6c1d (diff)
downloadnewlib-mingwex.zip
newlib-mingwex.tar.gz
newlib-mingwex.tar.bz2
* include/math.h (fdim, fdimf, fdiml): Add prototypes.github/mingwexmingwex
* mingwex/fdim.c: New file. * mingwex/fdimf.c: New file. * mingwex/fdiml.c: New file. * mingwex/Makefile.in (DISTFILES): Add fdim.c, fdimf.c, fdiml.c. (MATHOBJS):Add fdim.o, fdimf.o. fdiml.o.
-rw-r--r--winsup/mingw/ChangeLog10
-rw-r--r--winsup/mingw/include/math.h5
-rw-r--r--winsup/mingw/mingwex/Makefile.in4
-rw-r--r--winsup/mingw/mingwex/fdim.c7
-rw-r--r--winsup/mingw/mingwex/fdimf.c7
-rw-r--r--winsup/mingw/mingwex/fdiml.c7
6 files changed, 40 insertions, 0 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index f613625..8714776 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,3 +1,13 @@
+2002-06-11 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/math.h (fdim, fdimf, fdiml): Add prototypes.
+ * mingwex/fdim.c: New file.
+ * mingwex/fdimf.c: New file.
+ * mingwex/fdiml.c: New file.
+ * mingwex/Makefile.in (DISTFILES): Add fdim.c, fdimf.c,
+ fdiml.c.
+ (MATHOBJS):Add fdim.o, fdimf.o. fdiml.o.
+
2002-05-23 Danny Smith <dannysmith@users.sourceforge.net>
* mingwex/Makefile.in (DISTFILES): Add truncf.c, truncl.c.
diff --git a/winsup/mingw/include/math.h b/winsup/mingw/include/math.h
index 2de3248..c87b616 100644
--- a/winsup/mingw/include/math.h
+++ b/winsup/mingw/include/math.h
@@ -429,6 +429,11 @@ extern double fma (double, double, double);
extern float fmaf (float, float, float);
extern long double fmal (long double, long double, long double);
+/* x > y ? (x - y) : 0.0 */
+extern double fdim (double, double);
+extern float fdimf (float, float);
+extern long double fdiml (long double, long double);
+
/* one lonely transcendental */
extern double log2 (double _x);
extern float log2f (float _x);
diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in
index 0cb136e..59f8e40 100644
--- a/winsup/mingw/mingwex/Makefile.in
+++ b/winsup/mingw/mingwex/Makefile.in
@@ -31,6 +31,9 @@ DISTFILES = Makefile.in configure configure.in \
atoll.c \
copysignl.S \
dirent.c \
+ fdim.c \
+ fdimf.c \
+ fdiml.c \
feclearexcept.c \
fegetenv.c \
fegetexceptflag.c \
@@ -155,6 +158,7 @@ MATH_OBJS = \
trunc.o truncf.o truncl.o \
isnan.o isnanf.o isnanl.o \
fp_consts.o \
+ fdim.o fdimf.o fdiml.o \
fmax.o fmaxf.o fmaxl.o \
fmin.o fminf.o fminl.o \
fma.o fmaf.o fmal.o \
diff --git a/winsup/mingw/mingwex/fdim.c b/winsup/mingw/mingwex/fdim.c
new file mode 100644
index 0000000..330b092
--- /dev/null
+++ b/winsup/mingw/mingwex/fdim.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double
+fdim (double x, double y)
+{
+ return (isgreater(x, y) ? (x - y) : 0.0);
+}
diff --git a/winsup/mingw/mingwex/fdimf.c b/winsup/mingw/mingwex/fdimf.c
new file mode 100644
index 0000000..02bfc6e
--- /dev/null
+++ b/winsup/mingw/mingwex/fdimf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float
+fdimf (float x, float y)
+{
+ return (isgreater(x, y) ? (x - y) : 0.0F);
+}
diff --git a/winsup/mingw/mingwex/fdiml.c b/winsup/mingw/mingwex/fdiml.c
new file mode 100644
index 0000000..1c3d0aa
--- /dev/null
+++ b/winsup/mingw/mingwex/fdiml.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+long double
+fdiml (long double x, long double y)
+{
+ return (isgreater(x, y) ? (x - y) : 0.0L);
+}