uint overflow behaviour

rikki cattermole rikki at cattermole.co.nz
Wed Sep 15 10:19:20 UTC 2021


https://dlang.org/spec/expression.html#add_expressions

"7. If both operands are of integral types and an overflow or underflow 
occurs in the computation, wrapping will happen. For example, uint.max + 
1 == uint.min, uint.min - 1 == uint.max, int.max + 1 == int.min, and 
int.min - 1 == int.max."


More information about the Digitalmars-d-learn mailing list