Closed mtsokol closed 5 months ago
did we just mix up mod
and rem
?
julia> rem(-2, 10)
-2
julia> mod(-2, 10)
8
julia> mod(2, 10)
2
julia> rem(2, 10)
2
julia> mod(2, -10)
-8
julia> mod(-2, -10)
-2
I think we just need to add mod_nothrow
I think that we still could match Python behavior in terms of
%
operator and negative input. Array API standard describes several edge cases, and also says:And I think negative input falls into that rule. Therefore we could take a look at these differences:
Python
Julia