[Python-ideas] Complex rationals in Python.

Terry Reedy tjreedy at udel.edu
Mon Nov 24 21:41:35 CET 2008


Mark Dickinson wrote:
> On Mon, Nov 24, 2008 at 8:01 PM, Rocco Orlando Rossi
> <rocco.rossi at gmail.com> wrote:
>> I appreciate the inclusion of the fractions module in Python 2.6 and
>> therefore in Python 3.0. But I feel there's something missing: no
>> possibility for complex rationals (or arbitrary precision) integers.
> 
> This seems like a specialist need to me---one that belongs in a Python
> extension package or library, but not in core Python.

Call is 'algebra'?, and included quaternions.

> Another thought: the field Q(i) is just one of an infinite number
> of quadratic extensions of the field of rationals.  Why implement
> that one and not the others?  Put another way, the field of
> complex numbers is a fairly natural object, but the choice to
> represent it as reals adjoin sqrt(-1) is quite arbitrary---one
> could just as easily adjoin sqrt(-2), or sqrt(-3), or
> (-1+sqrt(-3))/2 instead.
> 
> Have you investigated sage? (www.sagemath.org)
> 
> Mark




More information about the Python-ideas mailing list