[Python-Dev] PEP239 (Rational Numbers) Reference Implementation and new issues
Peter Norvig
peter@norvig.com
Thu, 03 Oct 2002 13:15:01 -0700
I agree with pinard, although I think it is a manageable problem. I went
through this transition once, from Symbolics Lisp, in which integer
division truncates, to Common Lisp, in which it produces a rational.
After only an hour or two of fiddling with my various programs,
everything seemed to work; I was very happy. But after a few days, the
machine started to slow down mysteriously, especially on wake-up. It
took a while to discover the culprit was my screensaver program (which I
hadn't checked) -- it was displaying fish on the screen, and the
coordinates of the fish had become rationals quotients of thousand-digit
numbers.
-Peter
pinard@iro.umontreal.ca writes:
> While I agree with the theoretical arguments, I have the practical
fear that
> rationals could grow very big, rather quickly, in the course of a long
> computation involving them in various ways. By big, I mean the numerator
> and denominator of the fraction taken in isolation, not the number
itself.