float / double support in Python?

Jere Kahanpaa kahanpaa at gstar.astro.helsinki.fi
Wed Feb 26 12:47:31 EST 2003


Brandon Van Every <vanevery at 3dprogrammer.com> wrote:
> float and double support is very critical to ease-of-use for my 3D graphics
> programming work.  How does Python fare for number crunching?  I'm not so
> much concerned with efficiency, I'm not expecting much, but rather syntax,
> universality of support on different platforms, or other headaches /
> gotchas.  For instance it's not acceptable to represent a float /double as a
> string, it has to be 4 bytes / 8 bytes.  I heard at one point that people
> were considering abolishing floating point support from the language?

The Numeric package supports both ... and more. As a bonus Numeric does this
portably: instead of using 'float' or 'double', Numeric has types 'Float8',
'Float16', ..., 'Float128'. After all, this is what you are looking for, right?

You'd probably want to use the packge anyway for matrix operation support etc. 
'Vanilla' Python has only only type of floating point numbers: the float. It maps 
to the double data type of the underlying C implementation (in CPython, don't know 
about Jython).

Jere
-- 
It's hard to think outside the box when you ARE the box.
                            - unknown, alt.religion.kibology 




More information about the Python-list mailing list