[NumPy-Tickets] [NumPy] #2239: result of multiplication on uint64 incorrectly cast to float
NumPy Trac
numpy-tickets@scipy....
Wed Oct 31 11:19:14 CDT 2012
#2239: result of multiplication on uint64 incorrectly cast to float
-------------------------+--------------------------------------------------
Reporter: rainwoodman | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: devel
Keywords: |
-------------------------+--------------------------------------------------
test case:
import numpy
x = numpy.array(4, dtype='u8')
print (x * 2).dtype
# gives float64.
y = numpy.array(4, dtype='i8')
print (x * 2).dtype
# gives int64
The upcasting from uint64 to float64 is quite surprising,
and it breaks code where an integer is expected and an expression
as simple as x * 2 will raise an error.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/2239>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list