[Bug c++/45762] New: Same binary prints sign of nan on different systems.
j dot s4403 at gmail dot com
Thu Sep 23 15:31:00 GMT 2010
Due to a change in glibc, an identical binary compiled with g++ 4.3 and run on
different systems prints a different result for nan. In the program at the end
of the report, a x86_64 binary run on an Ubuntu 10.04.1 LTS prints "-nan" while
the same exact binary run on Ubuntu 8.04.4 LTS prints "nan".
In an article on stackoverflow.com, someone found that a change on 2009-08-23
in glibc printf routine is the reason for this:
* stdio-common/printf_fp.c: ISO C expects to print the sign of NaN
Is there a standard for c++ as to how the iostreams should format a nan?
using namespace std;
cout << 0./0. << endl;
Summary: Same binary prints sign of nan on different systems.
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: j dot s4403 at gmail dot com
More information about the Gcc-bugs