Repository navigation
BUG: one to any power is still 1. Broken edgecase for int arrays - #7651
Conversation
|
Ah, looking back now I see this all comes from raising to some power without |
|
Thanks Eric. |
|
@mhvk Oops, indeed. |
|
@ewmoore I'd still like to see this whole thing discussed on the list. We have incompatible behavior between scalars and arrays, plus the change to raise an error for the ufunc for division by zero. Not that there is anything wrong, but because this is a messy corner with some nasty tradeoffs, I'd like to have some sort of consensus as to the proper behavior. |
|
Note that this still leaves |
|
I posted to the list. Note that in 1.10 scalar arrays are not handled as arrays, but return int64. I think we need to propose the behavior we want and test all the integer types, together with +1, -1, 0. The tests do seem somewhat lacking at the moment. |
| *((@type@ *)op1) = 1; | ||
| continue; | ||
| } | ||
| if (in2 < 0 || in1 == 0) { |
There was a problem hiding this comment.
How about drop the previous if and
if (in2 < 0 && (in1 > 1 || in1 < -1)) {
And a special check for divide by zero.
Fixes gh-7648.