[Numpy-discussion] Weird upcast behavior with 1.6.x, working as intended?

Olivier Delalleau shish@keba...
Mon Aug 8 11:54:17 CDT 2011


This is with numpy 1.6.1 under Linux x86_64, testing the upcast mechanism of
"scalar + array":

>>> import numpy; print (numpy.array(3, dtype=numpy.complex128) +
numpy.ones(3, dtype=numpy.float32)).dtype

Since it has to upcast my array (float32 is not "compatible enough" with
complex128), why does it upcast it to complex64 instead of complex128?
As far as I can tell 1.4.x and 1.5.x versions of numpy are indeed upcasting
to complex128.


-=- Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110808/f3ddfd1a/attachment.html 

More information about the NumPy-Discussion mailing list