Array and floating point
robert.kern at gmail.com
Fri Aug 17 23:29:16 CEST 2007
Jonathan Shan wrote:
> I'm experiencing a problem where the float being appended to the array
> is not the same as the result of the appending.
>>>> from array import *
>>>> x = array('f')
> I'm expecting x = 0.10000000000000001
'f' denotes a single-precision floating point number. Python's float objects are
double-precision floating point numbers. Use 'd' instead.
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Python-list