On Friday, 21 November 2014 at 04:53:38 UTC, Walter Bright wrote:
BTW, granted the 0x7FFFFFFF problems exhibit the bugs less often, but paradoxically this can make the bug worse, because then it only gets found much, much later in supposedly tested & robust code.

0 crossing bugs tend to show up much sooner, and often immediately.

Wrong. Unsigned integers can hold bigger values, so it takes more to makes them overflow, hence the bug is harder to detect.

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html
Specifically, it fails if the sum of low and high is greater than the maximum positive int value

So it fails sooner for signed integers than for unsigned integers.

Reply via email to