Closed moble closed 2 years ago
A workaround for this is to explicitly call np.float_power
or even np.power
:
>>> import numpy as np
>>> import quaternionic
>>> np.float_power(quaternionic.x, 0.0)
quaternionic.array([1., 0., 0., 0.])
>>> np.power(quaternionic.x, 0.0)
quaternionic.array([1., 0., 0., 0.])
Presumably because numpy is taking a shortcut and trying to return ones, we get this:
On the other hand, it works as expected as long as the exponent is not precisely 0.0:
I also can't find any way to access
<ufunc '_ones_like'>
; it's different fromnp.ones_like
, for example. I think I'll have to find some way to override this shortcut.