- changed status to resolved
np.array loses dtype after integer division
Issue #35
resolved
CPython:
>>> import numpy as np
>>> np.__version__
'1.9.0'
>>> np.array(np.zeros(2), dtype=np.float32) / 2
array([ 0., 0.], dtype=float32)
PyPy 2.6.0:
>>>> np.array(np.zeros(2), dtype=np.float32) / 2
array([ 0., 0.])
>>>> _.dtype
dtype('float64')
>>>>
This does not happen with float division.
Comments (2)
-
-
reporter Great, thank you!
- Log in to comment
This has already been fixed in PyPy's default branch. With any recent nightly, you should get: