delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/01/20/06:07:30

X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
Date: Wed, 20 Jan 1999 11:26:20 +0100 (MET)
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
X-Sender: broeker AT acp3bf
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Bug when printing long doubles
In-Reply-To: <Pine.SUN.3.91.990120090404.2569C-100000@is>
Message-ID: <Pine.LNX.3.93.990120112136.2655A-100000@acp3bf>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

On Wed, 20 Jan 1999, Eli Zaretskii wrote:

> 
> On Tue, 19 Jan 1999, Hans-Bernhard Broeker wrote:
> 
> > To give my personal view of this: subnormals really should not give any
> > exceptional behaviour in printf(). We should strive to ensure that
> > printf() of such a number does produce a valid answer, if possible.
> > Printing NaN would be a lie, simply put. 
> 
> Well, then, what's your vote about what it *should* print?

It should print the actual value. After all, even an unnormalized fp
number does have a value. It'll be smaller than LBDL_MIN, I think, but
it's there. Of course, it my turn out to be quite tricky to get this done
right (we'ld have to normalize the number ourselves, by multiplying it by,
say, 1e100, and then keep in mind to modify the exponent of the printed
number accordingly). 

If that can't be done, printing 'FP:unnormal' or anything like that seems
reasonable, as long as we don't print 'NaN'. 

On a side issue: as per the C9x standard, it seems we'll have to change
from 'NaN' and 'Inf' to 'nan' and 'inf' at some point in time. Might be a
good idea to do it now, while we're at it... 

Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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