[Python-Dev] Re: PEP239 (Rational Numbers) Reference Implementation and new issues

Raymond Hettinger python@rcn.com
Wed, 2 Oct 2002 23:02:58 -0400


From: "Christian Tismer" <tismer@tismer.com>

> > Greg> The problem as I see it is not the magnitude of the number, but
> > Greg> that the number of significant bits grows without bound, if you
> > Greg> never throw any of them away.
> > 
> > So I'm suggesting that maybe it won't get bad as quickly if
> > you keep only the significant bits :-)
> 
> Yes. And this is what a rounding to float would do for you.

That is unless you wanted more precision than comes with a float.
Normalization to some arbitrary maximum denominator magnitude
would be a more general purpose solution.


Raymond Hettinger