arith-oflo: what is semantics of divide int::MIN.wrapped_div(-1)
#964
Labels
T-libs-api
Relevant to the library API team, which will review and decide on the RFC.
I am working through implementing #560
I had thought, from the name "wrapping", that
int::MIN.wrapped_div(-1)
would be defined as follows:but then I saw this comment on the RFC thread:
#560 (comment)
which suggests: "there is no undefined behaviour or values left (if we agree to defining the result of INT_MIN/-1 as INT_MAX)."
My thinking is that if one wants the latter semantic, then maybe we should give it a name other than
wrapping_div
... e.g. maybe have both:keywords: arithmetic overflow division divide wrapping
The text was updated successfully, but these errors were encountered: