J3/03-244 Date: 20-aug-2003 To: J3 From: Toon Moene Subject: Signed NaN's in I/O ------------- Page and line references are to 03-007 unless otherwise noted. The C standard specifies a format for the formatted input and output of NaN values. The description of the fprintf function (page 277 of the C standard) specifies the output formats as follows: For the "f" conversion specifier, the output formats include an optional leading minus sign: [-]nan [-]nan(n-char-sequence) For the "F" conversion specifier, the output formats are [-]NAN [-]NAN(n-char-sequence) For input using the fscanf function (page 284 of the C standard) the specified format for NaN's is the same as expected for the subject sequence of the strtod function (page 307 of the C standard). That format is the same as listed above for output except that there can be an optional leading "+" sign and the case of the letters in the "NAN" string is ignored. For interoperability with C it would be desirable to have the Fortran formatted input/output operations treat these forms as valid. The current wording of 03-007 allows these forms except for the possible leading sign. Edits: [230:19] Before "the string" add "an optional sign, followed by". [230:25] Append "The interpretation of a sign in a NaN input field is processor dependent." [230:31] Before "the letters" insert "an optional sign and". [230:32+3] Append "The presence of the optional sign is processor dependent."