Why does numpy's `2**np.array([64])` produces 0, whereas plain python's 2**64 gives the correct result?

41 Views Asked by At

It seems numpy's 2**np.array([64]) produces 0, which is a strange result. Why? I guess it has something to do with overflow, but feel unsure.

In [16]: 2**np.array([64])
Out[16]: array([0])

In [17]: 2**64
Out[17]: 18446744073709551616
0

There are 0 best solutions below