[Python-Dev] Google Summer of Code proposal: improvement of long int and adding new types/modules.

Guido van Rossum guido at python.org
Fri Apr 21 12:59:26 CEST 2006

On 4/21/06, Mateusz Rukowicz <mateusz.rukowicz at vp.pl> wrote:
> Guido van Rossum wrote:
> >On 4/21/06, Mateusz Rukowicz <mateusz.rukowicz at vp.pl> wrote:
> >>Next thing I would add is multi precision floating point type to the
> >>core and fraction type, which in some cases highly improves operations,
> >>which would have to be done using floating point instead.
> >>Of course, math module will need update to support multi precision
> >>floating points, and with that, one could compute asin or any other
> >>function provided with math with precision limited by memory and time.
> >>It would be also good idea to add function which computes pi and exp
> >>with unlimited precision.
> >
> >I would suggest doing this as a separate module first, rather than as
> >a patch to the Python core.
> >
> >Can you show us some practical applications of these operations?
> >
> Multi precision float is mostly used by physicians and mathematicians,

(Aside: you probably mean physicist, someone who practices physics. A
physician is a doctor; don't ask me why. :-)

> interpreted languages are particularly good for physics simulations, in
> which small error would grow so much, that results are useless.

We already have decimal floating point which can be configured to use
however many digits of precision you want. Would this be sufficient?
If you want more performance, perhaps you could tackle the very useful
project of translating decimal.py into C?

> Rational numbers would be used in codes where precision is of
> critical-importance, and one cannot accept rounding of results. So
> fraction (and also multi precision floating) would mostly be used in
> linear-programming algorithms, like solving set of equations or some
> optimizing methods.

I'm not sure I see the value of rational numbers implemeted in C;
they're easy to write in Python and all the time goes into division of
two ints which is already implemented in C.

> >>And last thing - It would be nice to add some number-theory functions to
> >>math module (or new one), like prime-tests, factorizations etc.
> >
> >Probably better a new module. But how many people do you think need these?
> >
> Mostly cryptography would exploit fast number-theory algorithms. Adding
> these as a module would boost and make easier to code everything which
> is related to cryptography, such as ssl, rsa etc. Also hobbyist looking
> for huge primes etc. would appreciate that, but it is not main purpose
> of these ;).

Have you looked at the existing wrappers around OpenSSL, such as
pyopenssl and m2crypto? ISTM that these provide most of the needed
algorithms, already coded in open source C.

> I understand that most of these improvements have quite limited
> audience, but I still think python should be friendly to them ;)

Sure. The question is, if there are more student applications than
Google wants to fund, which projects will be selected? I would
personally vote for the projects that potentially help out the largest
number of Python users.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list