What does float64 mean on a 32bit machine?
How can I have a float64 dtype on a 32bit machine? For example:
In [90]: x = array([1/3],dtype=float32)
In [91]: x Out[91]: array([ 0.33333334], dtype=float32)
In [92]: x = array([1/3],dtype=float64)
In [93]: x Out[93]: array([ 0.33333333])
Obviously, the float32 and float64 representations of 1/3 are different, but what is the meaning of float64 on a 32bit machine? Shouldn't a 32bit machine only be able represent float32?
Thanks!
On Wed, Mar 24, 2010 at 17:38, reckoner reckoner@gmail.com wrote:
How can I have a float64 dtype on a 32bit machine? For example:
float64 is a 64bit float on all machines. A "32bit machine" refers only to the size of its memory address space and the size of the integer type used for pointers. It has no effect on floating point types; 32 and 64bit versions are standard on all supported platforms though the higher precisions vary significantly from machine to machine regardless of whether it is 32 or 64bit.
reckoner wrote:
How can I have a float64 dtype on a 32bit machine? For example:
float64 is known as "double" in C, just for this reason.
Modern FPUs use 64 bit (actually more bits), so you can get very good performance with float64 on 32 bit machines.
And it is the standard Python float as well.
Chris
In [90]: x = array([1/3],dtype=float32)
In [91]: x Out[91]: array([ 0.33333334], dtype=float32)
In [92]: x = array([1/3],dtype=float64)
In [93]: x Out[93]: array([ 0.33333333])
Obviously, the float32 and float64 representations of 1/3 are different, but what is the meaning of float64 on a 32bit machine? Shouldn't a 32bit machine only be able represent float32?
Thanks!
NumPyDiscussion mailing list NumPyDiscussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpydiscussion
participants (3)

Christopher Barker

reckoner

Robert Kern