[Numpy-discussion] casting bug

Charles سمير Doutriaux doutriaux1 at llnl.gov
Tue May 26 19:17:08 EDT 2009


Hi there,

One of our users just found a bug in numpy that has to do with casting.

Consider the attached example.

The difference at the end should be  0 (zero) everywhere.

But it's not by default.

Casting the data to 'float64' at reading and assiging to the arrays  
works
Defining the arrays "at creation time" as "float32" works

But simply reading in the data (flaot32) and putting them into the  
default arrays (float64) leads to differences!

Thanks for looking into this,

C.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: squares.py
Type: text/x-python-script
Size: 507 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090526/1041fa90/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy_test_data.nc
Type: application/octet-stream
Size: 1580 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090526/1041fa90/attachment.obj>


More information about the NumPy-Discussion mailing list