[Patches] [ python-Patches-1012468 ] Rational.py various bugfixes

SourceForge.net noreply at sourceforge.net
Fri Sep 24 18:48:43 CEST 2004


Patches item #1012468, was opened at 2004-08-19 16:20
Message generated for change (Comment added) made by russblau
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1012468&group_id=5470

Category: Demos and tools
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Russell Blau (russblau)
Assigned to: Nobody/Anonymous (nobody)
Summary: Rational.py various bugfixes

Initial Comment:
Rational.py in the sandbox 
(python/python/nondist/sandbox/rational/Rational.py) 
contains a variety of minor (and not-so-minor) bugs, 
and some doctest errors as a result of changes 
introduced in recent Python versions.

A corrected version (that works for me) is attached.



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

>Comment By: Russell Blau (russblau)
Date: 2004-09-24 12:48

Message:
Logged In: YES 
user_id=855050

I have now uploaded a context diff.  As for the doctest 
errors: my limited investigation suggests that the manner in 
which Python prints float values in "scientific" notation is 
platform-dependent; on Windows, the exponent will always 
contain 3 digits, while on Linux, leading zeros in the exponent 
are suppressed.  If this is the case, then a doctest string 
containing output of this type of value will *always* fail for 
some users.  I am not sure what to do about this.

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

Comment By: Martin v. Löwis (loewis)
Date: 2004-09-18 11:32

Message:
Logged In: YES 
user_id=21627

Please submit patches as unified or context diffs.

The file you have attached fails for me as well, I get

**********************************************************************
File "/tmp/Rational.py", line 115, in Rational
Failed example:
    float(p.trim(1L<<32)-p)
Expected:
    -7.3974359428840768e-020
Got:
    -7.3974359428840768e-20
**********************************************************************
File "/tmp/Rational.py", line 126, in Rational
Failed example:
    float(p.approximate(rational(1L)>>32)-p)
Expected:
    1.3733999215941832e-011
Got:
    1.3733999215941832e-11
**********************************************************************

I have now untabified Rational.py, please use that as a
starting point for further changes.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1012468&group_id=5470


More information about the Patches mailing list