delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/09/20/05:50:20

Date: Sun, 20 Sep 1998 12:49:52 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: Printing very small negative FP numbers
Message-ID: <Pine.SUN.3.91.980920124204.406d-100000@is>
MIME-Version: 1.0

The current version of *printf always removes the sign from the printed
representation of small FP numbers that are printed as 0.000 etc. (i.e.,
no significant digits, only zeros).  This is done on purpose, since a poll
here some time ago indicated that people don't like to see -0.0000 in the
print-out.  (Linux *does* print the minus sign, as do some, but not all,
other platforms.)

The question is: what do we print if the user asked for the sign 
explicitly, like in "%+f"?  It would seem to me that in this case we 
*should* print the true sign of the number, even if the value is printed 
as all-zeros.  Currently, such numbers are always printed as +0.00000 
which could be interpreted as a lie, IMHO.

It doesn't seem too hard to fix this, if people think this should be 
fixed.

Comments?

- Raw text -


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