4 ms·
> Effectively the if statement was inverted. If this wording means to convey that the complete test in the wrong code version is always giving the inverse of t
by pflanze 4y ago
> Effectively the if statement was inverted.
If this wording means to convey that the complete test in the wrong code version is always giving the inverse of the correct version, then that statement is wrong. The truth tables, using 0 and 1 for false and true ("false" and "true" look too messy here):
The buggy code:
0 1+ <- second condition
0 1 1
1 1 0
^- first condition
The fixed code:
0 1+ <- second condition
0 0 0
1 1 0
^- first condition
i.e. the test as a whole is not inverted if the first subcondition is true.