www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/19/11:29:57

Date: Sun, 19 Jul 1998 18:28:00 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Testing the *printf family
Message-ID: <Pine.SUN.3.91.980719181945.1021G-100000@is>
MIME-Version: 1.0

The last version of libm (that is now part of the latest alpha) came 
with a test program.  It turns out that it tests not only the math 
functions, but others as well, so I'm using it to run some rgeression 
tests (that's how the minor bugs in strtod were unearthed).

One particular case where I get many discrepancies is the case like the 
following:

        double  delta = -1e-7;
        printf("delta = %f, %g\n", delta, delta);

This prints 0.000000 in DJGPP and Borland, but -0.000000 in Microsoft 
(and Linux as well, as I'm told).

Personally, I'd prefer to see the minus sign, since it alerts the user 
that the quantity is actually negative, and that more digits are needed 
to see the value.

However, this seems to be implementation-dependent behavior, so I'm 
unsure whether it needs to be fixed.

Therefore, it's up to you.  If enough people want it to be corrected, 
I'll try.  In particular, I'd like to know how do other environments 
(besides the ones cited above) behave in this case.

- Raw text -


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