arkouda icon indicating copy to clipboard operation
arkouda copied to clipboard

Address `**` Edge Cases

Open Ethan-DeBandi99 opened this issue 2 years ago • 1 comments

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])

Ethan-DeBandi99 avatar Aug 29 '22 22:08 Ethan-DeBandi99

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

stress-tess avatar Aug 30 '22 17:08 stress-tess