Skip to content

Commit ada1e31

Browse files
authored
Clarify signed integer overflow by explicit example. (#2727)
Clarify signed integer overflow by explicit example. merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
1 parent b093478 commit ada1e31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spec/expression.dd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,9 @@ $(GNAME AddExpression):
789789
)
790790

791791
$(P If both operands are of integral types and an overflow or underflow
792-
occurs in the computation, wrapping will happen. That is,
793-
$(D uint.max + 1 == uint.min) and $(D uint.min - 1 == uint.max).
792+
occurs in the computation, wrapping will happen. For example,
793+
$(D uint.max + 1 == uint.min), $(D uint.min - 1 == uint.max),
794+
$(D int.max + 1 == int.min), and $(D int.min - 1 == int.max).
794795
)
795796

796797
$(P Add expressions for floating point operands are not associative.

0 commit comments

Comments
 (0)