delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/03/16/14:10:02

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200003161842.TAA03694@father.ludd.luth.se>
Subject: Re: Unnormals???
In-Reply-To: <Pine.SUN.3.91.1000316125955.3856B-100000@is> 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
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019