3 ms·
The submission is a tweet which doesn't really have a title, so the submitter was forced to make up one. Unfortunately the assertion in the chosen title is not
by tzs 5y ago
The submission is a tweet which doesn't really have a title, so the submitter was forced to make up one. Unfortunately the assertion in the chosen title is not correct. In Python the mod operator returns a number with the same sign as the second argument:
>>> 10%3
1
>>> (-10)%3
2
>>> 10%(-3)
-2
>>> (-10)%(-3)
-1
- tosh 5y agoThank you for highlighting this.
- 0xdeadb00f 5y agoI was going to mention this, having literally just run into this behavior yesterday.