This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Rational.py various bugfixes
Type: Stage:
Components: Demos and Tools Versions: Python 2.3
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: jyasskin Nosy List: georg.brandl, jyasskin, loewis, russblau
Priority: normal Keywords: patch

Created on 2004-08-19 20:20 by russblau, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Rational.py russblau, 2004-08-19 20:20 corrected Rational.py module
rat_diff.txt russblau, 2004-09-24 16:48 Context diff for Rational.py
Messages (5)
msg46746 - (view) Author: Russell Blau (russblau) Date: 2004-08-19 20:20
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.

msg46747 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-09-18 15:32
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.
msg46748 - (view) Author: Russell Blau (russblau) Date: 2004-09-24 16:48
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.
msg61426 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-21 17:39
Now that we have a (different) rational module in the stdlib, shouldn't
we remove this one altogether?
msg63174 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-03-01 22:43
Yep. Removed in r61162.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40791
2008-03-01 22:43:24jyasskinsetstatus: open -> closed
resolution: out of date
messages: + msg63174
2008-01-21 17:39:54georg.brandlsetassignee: jyasskin
messages: + msg61426
nosy: + georg.brandl, jyasskin
2004-08-19 20:20:35russblaucreate