[Python-bugs-list] [ python-Bugs-460615 ] test_fpformat fails on SGI

noreply@sourceforge.net noreply@sourceforge.net
Tue, 11 Sep 2001 09:48:19 -0700


Bugs item #460615, was opened at 2001-09-11 01:26
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470

Category: None
>Group: 3rd Party
Status: Open
Resolution: None
Priority: 5
Submitted By: Sjoerd Mullender (sjoerd)
Assigned to: Nobody/Anonymous (nobody)
Summary: test_fpformat fails on SGI

Initial Comment:
With the current version of Python on IRIX 6.5.13,
compiled without -O, test_fpformat fails.
It boils down to this: fpformat.fix(-0.003, 0) results
in the string "-0" whereas "%.*f" % (0, float(-0.003))
results in "0".

The output of the test is
+ ./python ../Lib/test/regrtest.py test_fpformat.py
test_fpformat
test test_fpformat failed -- Traceback (most recent
call last):
  File "../Lib/test/test_fpformat.py", line 51, in
test_reasonable_values
    self.checkFix(realVal, d)
  File "../Lib/test/test_fpformat.py", line 28, in
checkFix
    self.assertEquals(result, expected)
  File
"/ufs/sjoerd/src/Python/dist/src/Lib/unittest.py", line
280, in failUnlessEqual
    raise self.failureException, (msg or '%s != %s' %
(first, second))
AssertionError: -0 != 0

1 test failed:
    test_fpformat


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-09-11 09:48

Message:
Logged In: YES 
user_id=31435

Guido's getting pretty good at this <wink>.  Try

printf("%.0f\n", -0.003);

in C on this box.  If that omits a minus sign, the platform 
libc is in error.  Changed Group to 3rd Party assuming 
that's what's happening.

----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2001-09-11 06:07

Message:
Logged In: YES 
user_id=6380

Channeling Tim:

Congratulations! You have found a bug in the C standard
library implementation on your platform.

:-)

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=460615&group_id=5470