You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/docs/guide/src/triangle.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,7 @@ We connect the correctness of `loop_triangle`'s return value to our mathematical
12
12
in `loop_triangle`'s `ensures` clause.
13
13
14
14
However, to successfully verify `loop_triangle`, we need a few more things. First, in executable
15
-
code, we have to worry about the possibility of arithmetic overflow. To that end, the function requires its
16
-
output to be less than `0x1_0000_0000`. This is 16^8, or 2^32, which is the limit of the range of values that can fit
17
-
in a `u32`.
15
+
code, we have to worry about the possibility of arithmetic overflow. To keep the overflow reasoning simple, we add a precondition to `loop_triangle` saying that the result needs to fit within a `u32`.
18
16
19
17
We also need to translate the knowledge that the final `triangle` result fits in a `u32`
20
18
into the knowledge that each individual step of computing the result won't overflow,
0 commit comments