[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r1557 - in /branches/eglibc-2_3/libc: ChangeLog.eglibc stdio-common/tstdiomisc.c
- To: commits@xxxxxxxxxx
- Subject: [commits] r1557 - in /branches/eglibc-2_3/libc: ChangeLog.eglibc stdio-common/tstdiomisc.c
- From: joseph@xxxxxxxxxx
- Date: Fri, 23 Feb 2007 21:23:52 -0000
Author: joseph
Date: Fri Feb 23 13:23:52 2007
New Revision: 1557
Log:
Backport from mainline.
2006-01-07 Ulrich Drepper <drepper@xxxxxxxxxx>
* stdio-common/tstdiomisc.c (F): Use NAN to get NaN value.
Modified:
branches/eglibc-2_3/libc/ChangeLog.eglibc
branches/eglibc-2_3/libc/stdio-common/tstdiomisc.c
Modified: branches/eglibc-2_3/libc/ChangeLog.eglibc
==============================================================================
--- branches/eglibc-2_3/libc/ChangeLog.eglibc (original)
+++ branches/eglibc-2_3/libc/ChangeLog.eglibc Fri Feb 23 13:23:52 2007
@@ -1,3 +1,9 @@
+2007-02-23 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ Backport from mainline.
+ 2006-01-07 Ulrich Drepper <drepper@xxxxxxxxxx>
+ * stdio-common/tstdiomisc.c (F): Use NAN to get NaN value.
+
2006-11-08 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
* sysdeps/arm/eabi/bits/predefs.h (__STDC_IEC_559__,
Modified: branches/eglibc-2_3/libc/stdio-common/tstdiomisc.c
==============================================================================
--- branches/eglibc-2_3/libc/stdio-common/tstdiomisc.c (original)
+++ branches/eglibc-2_3/libc/stdio-common/tstdiomisc.c Fri Feb 23 13:23:52 2007
@@ -46,6 +46,9 @@
return result;
}
+volatile double nanval;
+
+
static int
F (void)
{
@@ -53,8 +56,9 @@
wchar_t wbuf[10];
int result;
- snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
- DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+ nanval = NAN;
+
+ snprintf (buf, sizeof buf, "%f %F", nanval, nanval);
result = strcmp (buf, "nan NAN") != 0;
printf ("expected \"nan NAN\", got \"%s\"\n", buf);
@@ -62,9 +66,7 @@
result |= strcmp (buf, "inf INF") != 0;
printf ("expected \"inf INF\", got \"%s\"\n", buf);
- swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
- DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX,
- DBL_MAX * DBL_MAX - DBL_MAX * DBL_MAX);
+ swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", nanval, nanval);
result |= wcscmp (wbuf, L"nan NAN") != 0;
printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf);