float / double support in Python?

Andrew Dalke adalke at mindspring.com
Wed Feb 12 15:23:16 EST 2003


Brandon Van Every:
> It doesn't have to be zero overhead.  It needs to be less overhead than
> doubles, both in space and time.

Implementing a "single" datatype as a Python extension, along with
the appropriate coercions to other data types (int and float) would
not be very hard.  In fact, you can almost certainly copy&paste from
the exisiting floatobject module.  I would hazard it would take about
a day or two to implement.

Do so, and make it available for others to use.  If it becomes
used enough, there will be an effort to make it part of the core,
just like FixedPoint.  BTW, C++ doesn't have a standard fixed
precision class, which is more important to a lot of people (eg,
bankers) than the space difference betweeen float and double.

                    Andrew
                    dalke at dalkescientific.com







More information about the Python-list mailing list