Rationals and Linear Programming in Python

Olaf Delgado delgado at eva17.Mathematik.Uni-Bielefeld.DE
Sun May 12 19:55:47 EDT 2002


Noah Spurrier wrote:
>Can anyone point me to the current state of the art in
>Rational number modules for Python? I'm surprised that
>Numerical Python does not do rationals.

I use crat by Christopher Craig. It's written in C, uses Python's own
long integers and an optimized gcd routine, so it's pretty fast. A gmp
based module might be faster in some situation because of their
supposedly more efficient integer type, but I haven't checked that.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pythonic/crat/

There are separate versions for Python 2.1 and 2.2 in the CVS. Older
versions are not supported as far as I've seen.

Olaf



More information about the Python-list mailing list