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.

Author rhettinger
Recipients facundobatista, gvanrossum, jyasskin, mark.dickinson, rhettinger
Date 2008-01-10.00:29:16
SpamBayes Score 0.10358839
Marked as misclassified No
Message-id <1199924957.32.0.750589984318.issue1682@psf.upfronthosting.co.za>
In-reply-to
Content
> If it's lossless, why not just allow 
>Decimal(Rational(...)) and Rational(Decimal(...))?

Those conversions are fine.  

It's the float<-->rational conversions that are problematic.  There are
exact float to rational conversions using math.frexp() but I don't think
the results tend to match what users expect (since 1.1 isn't exactly
represented).  Also, there may be overflow issues with trying to go from
rationals to floats when the denomintor is very large.

I think the history of rational modules is that simplistic
implementations get built and then the writers find that exploding
denominators limit their usefulness for anything other than trivial
problems.  The solution is to limit denominators but that involves less
trivial algorithms and a more sophisticated API.
History
Date User Action Args
2008-01-10 00:29:17rhettingersetspambayes_score: 0.103588 -> 0.10358839
recipients: + rhettinger, gvanrossum, facundobatista, mark.dickinson, jyasskin
2008-01-10 00:29:17rhettingersetspambayes_score: 0.103588 -> 0.103588
messageid: <1199924957.32.0.750589984318.issue1682@psf.upfronthosting.co.za>
2008-01-10 00:29:16rhettingerlinkissue1682 messages
2008-01-10 00:29:16rhettingercreate