arkouda
arkouda copied to clipboard
Address `**` Edge Cases
Numpy has variations when using **
, power
, or sqrt
>>> n = np.array([-0.0, -7, -np.inf])
>>> n**0.5
array([-0., nan, nan])
>>> np.power(n, 0.5)
array([ 0., nan, inf])
>>> np.sqrt(n)
array([-0., nan, nan])
>>> n**(1/3)
array([ 0., nan, inf])
>>> np.power(n, 1/3)
array([ 0., nan, inf])
>>> n**(1/4)
array([ 0., nan, inf])
>>> np.power(n, 1/4)
array([ 0., nan, inf])
I think most of the edge cases can be handled by using the chapel sqrt
function, so that might be worth looking into a bit