delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/03/19/11:51:06

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200003191606.RAA22393@father.ludd.luth.se>
Subject: Re: Unnormals???
In-Reply-To: <Pine.SUN.3.91.1000319115441.13844V-100000@is> from Eli Zaretskii at "Mar 19, 2000 11:54:57 am"
To: djgpp-workers AT delorie DOT com
Date: Sun, 19 Mar 2000 17:06:08 +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:
> > The C99 explicitly mentions signs of NaNs in its output specification for
> > *printf(), and also in strtod()/*scanf() input. I don't think we can just
> > say the a NaN with the sign bit set is *not* negative.
> 
> I think we can, since the sign bit of a NaN is not an indication of
> it's being negative, when the real indefinite is concerned.

My reading of the standard says the sign of a negative NaN should be
printed. Nowhere it says we are allowed not to print it.

When the standard say e. g. "[-]nan" it also says "[-]ddd.ddd" for
ordinary numbers. This means (to me) that NaNs should be treated as
ordinary numbers as far as the sign is concerned. This means (to me)
that the "[-]" isn't optional, it's just short-hand for "print the
sign if it's negative".

Please read the standard and form your own opinion.


Bay Laurel, Days of Joy,

							MartinS

- Raw text -


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