Annex F (informative) Core undefined behavior [ub]

F.3 [expr]: Expressions [ub.expr]

F.3.29[ub:expr.mul.representable.type.result]
Specified in: [expr.mul]

If the quotient a/b is representable in the type of the result, (a/b)*b + a%b is equal to a; otherwise, the behavior of both a/b and a%b is undefined.
[Example 1: #include <limits> int main() { int x = std::numeric_limits<int>::min() / -1; // Assuming LP64 which when divided by // gives us 2,147,483,648 which is not representable by int. } — end example]