Without knowing the intended use case of the code, the edge case behavior in some of these cases is pretty meaningless. Different behavior might make sense in different applications, and in many applications the choice is largely irrelevant. Whichever one you choose someone who wants the other version will have to work around it.
These examples don’t really have much bearing on the general usefulness of “remainder” vs. “modulo” though.
- https://github.com/JuliaLang/julia/issues/14826
- https://github.com/JuliaLang/julia/issues/17415 - https://github.com/JuliaLang/julia/issues/3127 - https://github.com/JuliaLang/julia/issues/3104 I'm pretty sure there are more issues.re: mod 2pi, typically it is most accurate to reduce to (-pi,pi) (i.e. division rounding to nearest). Also to get it accurate you need fancy range reduction algorithms, hence julia has rem2pi https://docs.julialang.org/en/stable/base/math/#Base.Math.re...