What does float64 mean on a 32-bit machine?

How can I have a float64 dtype on a 32-bit 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 32-bit machine? Shouldn't a 32-bit 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 32-bit machine? For example:
float64 is a 64-bit float on all machines. A "32-bit 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 64-bit versions are standard on all supported platforms though the higher precisions vary significantly from machine to machine regardless of whether it is 32- or 64-bit. -- Robert Kern "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

reckoner wrote:
How can I have a float64 dtype on a 32-bit 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 32-bit machine? Shouldn't a 32-bit machine only be able represent float32?
Thanks!
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov
participants (3)
-
Christopher Barker
-
reckoner
-
Robert Kern