Message-Id: <200003151552.KAA17013@delorie.com> From: "Dieter Buerssner" To: Eli Zaretskii Date: Wed, 15 Mar 2000 16:51:48 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Subject: Re: Unnormals??? CC: djgpp-workers AT delorie DOT com References: <200003151300 DOT IAA05344 AT delorie DOT com> In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12b) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id KAA17015 Reply-To: djgpp-workers AT delorie DOT com On 15 Mar 00, Eli Zaretskii wrote: > On Wed, 15 Mar 2000, Dieter Buerssner wrote: > > > When you printf a NaN that was procuced by a sqrt domain error, it > > might print "nan(sqrt)". This, at least is my interpretation. > > Can you tell on what this interpretation is based, or point to other > platforms which do something similar? I cannot find anything in the > Standard's language that would hint on what those n-chars could be. This is all from memory only, sorry. But the Standard says, that the meaning of n-char-sequence is implementation defined. In 7.20.1.3 (in the draft, strtod and friends) there is [...] one of NAN or NAN(n-char-sequence opt ), ignoring case in the NAN part, where: n-char-sequence: digit nondigit n-char-sequence digit n-char-sequence nondigit The subject sequence is defined as the longest initial subsequence of the input string, starting with the first non-white-space character, that is of the expected form. The subject sequence contains no characters if the input string is not of the expected form. In the footnote 236) An implementation may use the n-char-sequence to determine extra information to be represented in the NaN’s significand. It could be, that I have found something about my interpretation in the C Rationale and/or in some Sun manuals as well. But I have no access to these documents anymore. So my interpretation should be read with caution. > Did you check the latest library? AFAIK, it doesn't suppress the sign > of a NaN anymore, at least not in all cases. I just checked. If I have not done anything stupid, it still suppresses the sign (as suggested by the source of doprint). It could be, that this is Standard conforming nevertheless, because the sign may be optional. Regards, Dieter