Mail Archives: djgpp-workers/2000/03/16/14:10:02
According to Eli Zaretskii:
> On Thu, 16 Mar 2000, Martin Stromberg wrote:
> > I suggest we print "nan(unnormal)" or "nan(unnormal0x<bit pattern>)"
> > where <bit pattern> is the bits of the double float in hexadecimal.
>
> I'm still not sure this is allowed, but if it is, I think that
> "nan(0x<bit pattern>)" is enough.
Let me quote the standard. In 7.20.1.3 (about strto{d,f,ld}):
"The expected form of the subject sequence is an optional plus or
minus sign, then one of the following:
...
-- one of INF or INFINITY, ignoring case
-- one of NAN or NAN(n-char-sequence{opt}), ignoring case in the NAN
part, where:
[syntax descibing the n-char-sequence, which in regex is
'[A-Za-z0-9_]+', note the {opt} thing above which really is a
subscript of n-char-sequence, making the n-char-sequence optional]
...
A character sequence INF or INFINITY is interpreted as an infinity, if
representable in the return type, else like a floating constant that
is too large for the range of the return type. A character sequence
NON or NAN(n-char-sequence{opt}), is interpreted as a quiet NaN, if
supported in the return type, else like a subject sequence part that
does not have the expected form; the meaning of the n-char-sequences
is implementation-defined. f.n. 250)
...
----------
f.n. 250) An implemenation may use the n-char-sequence to determine
extra information to be represented in the NaN's significand."
In 7.19.6.1 (about fprintf):
"The conversion specifiers and their meanings are:
...
f, F A double argument...
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. f.n. 234)
...
e, E ...
[Refers to f or F regarding infinity and NaN. Likewise for g,
G]
----------
f.n.234) When applied to infinite and NaN values, the -, +, and space
flag characters have their usual meaning; the # and 0 flag characters
have no effect.
Messiaen, Turangalila-symphonie,
MartinS
- Raw text -