News for hackers. Stuff that matters.
Re:A Dig Through Old Files Reminds Me Why I’m So Critical of... by nl on Sunday November 03, 2013 @05:55PM (#6665515)
Implementations of common algorithms are even worse.

The Java binary search implementation had a bug that eluded detection for 9 years, and it was based on a implementation from the 1986 book "Programming Pearls" that also contained the same bug (TL;RD: it's an overflow error that computers in 1986 would probably never have run into - who could imagine having an array with more than 2^30 elements?!).

Even worse: While the first binary search was published in 1946, the first binary search that works correctly for all values of n did not appear until 1962. - and this bug shows it is likely this 1962 version would have failed the same way.

See http://googleresearch.blogspot.com.au/2006/06/extra-extra-re...

Re:A Dig Through Old Files Reminds Me Why I’m So Critical of... by im3w1l on Sunday November 03, 2013 @10:28PM (#6666620)
Curiously, most c programs with 2^30 element arrays will probably have 64 bit ints, and will therefore work. In the time the code original code was written, I suppose the ints would have been 16 bit?