For int a, b, I know that when there is exactly one of a and b is negative, the result of a / b and a % b is machine dependent. But do I always have (a / b * b) + a % b == a when b is not zero?
For int a, b , I know that when there is exactly one of
Share
C++11 §5.6[expr.mul]/4 specifies:
C11 §6.5.5/6 specifies the same with slightly different phrasing: