On 11/21/2014 12:10 AM, Daniel Murphy wrote:
"Walter Bright"  wrote in message news:m4mggi$e1h$1...@digitalmars.com...

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.

I don't think I have ever written a D program where an array had more than 2^^31
elements.  And I'm sure I've never had it where 2^31-1 wasn't enough and yet
2^^32-1 was.

There turned out to be such a bug in one of the examples in "Programming Pearls" that remained undetected for many years:

http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html


Zero, on the other hand, is usually quite near the typical array lengths and
differences in lengths.

That's true, that's why they are detected sooner, when it is less costly to fix them.

Reply via email to