[Python-ideas] Floating point contexts in Python core

Alexander Belopolsky alexander.belopolsky at gmail.com
Thu Oct 11 06:20:17 CEST 2012


On Wed, Oct 10, 2012 at 9:44 PM, Guido van Rossum <guido at python.org> wrote:
> Anyway, as an indication of the amount of work, you might want to look
> at the fpectl module -- the module itself is tiny, but its
> introduction required a huge amount of changes to every place where
> CPython uses a double.

I would start from another end.  I would look at decimal.py first.
This is little over 6,400 line of code and I think most of it can be
reused to implement base 2 (or probably better base 16) float.
Multi-precision binary float can coexist with existing float until
the code matures and accelerators are written for major platforms.  At
the same time we can make incremental improvements to builtin float
until it can be replaced by a multi-precision float in some
well-defined context.



More information about the Python-ideas mailing list