From: Martin Str|mberg Message-Id: <200003161842.TAA03694@father.ludd.luth.se> Subject: Re: Unnormals??? In-Reply-To: from Eli Zaretskii at "Mar 16, 2000 01:06:12 pm" To: djgpp-workers AT delorie DOT com Date: Thu, 16 Mar 2000 19:42:17 +0100 (MET) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk According to Eli Zaretskii: > On Thu, 16 Mar 2000, Martin Stromberg wrote: > > I suggest we print "nan(unnormal)" or "nan(unnormal0x)" > > where 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)" 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