How about adding rational fraction to Python?

Mensanator mensanator at aol.com
Mon Feb 25 09:41:23 EST 2008


On Feb 25, 12:58�am, Carl Banks <pavlovevide... at gmail.com> wrote:
> On Feb 24, 10:56 pm, Mensanator <mensana... at aol.com> wrote:
>
> > But that doesn't mean they become less manageable than
> > other unlimited precision usages. Did you see my example
> > of the polynomial finder using Newton's Forward Differences
> > Method? The denominator's certainly don't settle out, neither
> > do they become unmanageable. And that's general mathematics.
>
> No, that's a specific algorithm. �That some random algorithm doesn't
> blow up the denominators to the point of disk thrashing doesn't mean
> they won't generally.
>
> Try doing numerical integration sometime with rationals, and tell me
> how that works out. �Try calculating compound interest and storing
> results for 1000 customers every month, and compare the size of your
> database before and after.

Nobody said rationals were the appropriate solution
to _every_ problem, just as floats and integers aren't
the appropriate solution to _every_ problem.

Your argument is that I should be forced to use
an inappropriate type when rationals _are_
the appropriate solution.

I have never used the Decimal type, but I'm not
calling for it's removal because I know there are
cases where it's useful. If a rational type were
added, no one would force you to use it for
numerical integration.

>
> Carl Banks




More information about the Python-list mailing list