[Numpy-discussion] float32 to float64 casting

Gökhan Sever gokhansever at gmail.com
Thu Nov 15 22:24:38 EST 2012


Could someone briefly explain why are these two operations are casting my
float32 arrays to float64?

I1 (np.arange(5, dtype='float32')).dtype
O1 dtype('float32')

I2 (100000*np.arange(5, dtype='float32')).dtype
O2 dtype('float64')

I3 (np.arange(5, dtype='float32')[0]).dtype
O3 dtype('float32')

I4 (1*np.arange(5, dtype='float32')[0]).dtype
O4 dtype('float64')


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20121115/ddfb3270/attachment.html>

More information about the NumPy-Discussion mailing list