There seems to be a problem when an ostringstream gets its input from, f.i., a double. I've noticed the problem for at least exact halfway cases such as 4.5. In two of the four cases, the output is incorrect. The same behaviour is present in g++ 4.0.0 (prerelease 20050319).
-- Summary: ostringstream ignores fenv settings (incorrect output) Product: gcc Version: 3.3.4 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: stefan dot becuwe at ua dot ac dot be CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: gcc version 3.3.4 (pre 3.3.5 20040809) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22542