[Bug c/45620] GCC library allows the use of a negative value for 'NAN'
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Thu Sep 9 20:46:00 GMT 2010
------- Comment #4 from jakub at gcc dot gnu dot org 2010-09-09 20:45 -------
The C99 standard says the sign should be printed even for NaN, see
7.19.6.1/8:
... "A double argument representing an infinity is converted in one of the
styles [-]inf or [-]infinity â which style is implementation-defined. A
double argument representing a NaN is converted in one of the styles
[-]nan or [-]nan(n-char-sequence) â which style, and the meaning of
any n-char-sequence, is implementation-defined. The F conversion specifier
produces INF, INFINITY, or NAN instead of inf, infinity, or nan,
respectively." ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45620
More information about the Gcc-bugs
mailing list