numpy bug with negative int pow
13 Aug
2013
13 Aug
'13
5:30 a.m.
Python 3.3.1 (default, Apr 17 2013, 22:32:14) [GCC 4.7.3] on linux
import numpy numpy.__version__ '1.8.0.dev-d62f11d'
numpy.array((1,2,3)) / 2 array([ 0.5, 1. , 1.5])
#ok, but since division of integer arrays has been converted to float, pow is expected as well, but it's not:
numpy.array((1,2,3)) ** -1 array([1, 0, 0], dtype=int32)
numpy.array((1,2,3)) ** -2 array([1, 0, 0], dtype=int32)
3**-1 0.3333333333333333
D.
4052
Age (days ago)
4052
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitrey