Mail Archives: djgpp-workers/2000/03/15/11:43:46
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
- Raw text -