aboutsummaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-08-10 21:02:28 +0000
committerJeff Johnston <jjohnstn@redhat.com>2005-08-10 21:02:28 +0000
commit234cf97f858cc122f816a72a4e41a2191df5b005 (patch)
treeca6b66bf6c175282d087b1c3c7a313b0fb5c180b /newlib
parent56448afa06abf287d8bfbd45b1a040ab32d54bb9 (diff)
downloadnewlib-234cf97f858cc122f816a72a4e41a2191df5b005.zip
newlib-234cf97f858cc122f816a72a4e41a2191df5b005.tar.gz
newlib-234cf97f858cc122f816a72a4e41a2191df5b005.tar.bz2
2005-08-10 Stephen Huw Clarke <stephen.clarke@st.com>
* libm/common/sf_fmax.c: Fix to properly handle NaNs. * libm/common/s_max.c: Ditto. * libm/common/sf_fmin.c: Ditto. * libm/common/s_min.c: Ditto.
Diffstat (limited to 'newlib')
-rw-r--r--newlib/ChangeLog7
-rw-r--r--newlib/libm/common/s_fmax.c4
-rw-r--r--newlib/libm/common/s_fmin.c4
-rw-r--r--newlib/libm/common/sf_fmax.c4
-rw-r--r--newlib/libm/common/sf_fmin.c4
5 files changed, 15 insertions, 8 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 83e32fa..6d8ec65 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-10 Stephen Huw Clarke <stephen.clarke@st.com>
+
+ * libm/common/sf_fmax.c: Fix to properly handle NaNs.
+ * libm/common/s_max.c: Ditto.
+ * libm/common/sf_fmin.c: Ditto.
+ * libm/common/s_min.c: Ditto.
+
2005-08-10 DJ Delorie <dj@redhat.com>
* configure.host: Add m32c support.
diff --git a/newlib/libm/common/s_fmax.c b/newlib/libm/common/s_fmax.c
index 2de04ef..53e1559 100644
--- a/newlib/libm/common/s_fmax.c
+++ b/newlib/libm/common/s_fmax.c
@@ -17,9 +17,9 @@
#endif
{
if (__fpclassifyd(x) == FP_NAN)
- return x;
- if (__fpclassifyd(y) == FP_NAN)
return y;
+ if (__fpclassifyd(y) == FP_NAN)
+ return x;
return x > y ? x : y;
}
diff --git a/newlib/libm/common/s_fmin.c b/newlib/libm/common/s_fmin.c
index f9eb51c..65e0b1c 100644
--- a/newlib/libm/common/s_fmin.c
+++ b/newlib/libm/common/s_fmin.c
@@ -17,9 +17,9 @@
#endif
{
if (__fpclassifyd(x) == FP_NAN)
- return x;
- if (__fpclassifyd(y) == FP_NAN)
return y;
+ if (__fpclassifyd(y) == FP_NAN)
+ return x;
return x < y ? x : y;
}
diff --git a/newlib/libm/common/sf_fmax.c b/newlib/libm/common/sf_fmax.c
index 292b99e..ac1bf46 100644
--- a/newlib/libm/common/sf_fmax.c
+++ b/newlib/libm/common/sf_fmax.c
@@ -15,9 +15,9 @@
#endif
{
if (__fpclassifyf(x) == FP_NAN)
- return x;
- if (__fpclassifyf(y) == FP_NAN)
return y;
+ if (__fpclassifyf(y) == FP_NAN)
+ return x;
return x > y ? x : y;
}
diff --git a/newlib/libm/common/sf_fmin.c b/newlib/libm/common/sf_fmin.c
index 4ef3510..f0e3444 100644
--- a/newlib/libm/common/sf_fmin.c
+++ b/newlib/libm/common/sf_fmin.c
@@ -15,9 +15,9 @@
#endif
{
if (__fpclassifyf(x) == FP_NAN)
- return x;
- if (__fpclassifyf(y) == FP_NAN)
return y;
+ if (__fpclassifyf(y) == FP_NAN)
+ return x;
return x < y ? x : y;
}