News for hackers. Stuff that matters.
Re:Collection of classic computer science algorithms written... by lbolla on Monday June 13, 2011 @10:12AM (#2649060)
The implementation of the binary_search algorithm (https://github.com/nzakas/computer-science-in-javascript/blo...) is bugged by the infamous (http://googleresearch.blogspot.com/2006/06/extra-extra-read-...) "integer overflow" bug:

   middle = Math.floor((stopIndex + startIndex)/2);
Re:Collection of classic computer science algorithms written... by Tuna-Fish on Monday June 13, 2011 @11:00AM (#2649219)
No, it's not. Because JS has no integers -- stopIndex and startIndex are doubles.
Re:Collection of classic computer science algorithms written... by kenjackson on Monday June 13, 2011 @11:59AM (#2649494)
So then the less infamous double overflow problem. :-)
Re:Collection of classic computer science algorithms written... by tybris on Monday June 13, 2011 @12:30PM (#2649625)
I dare you to make an array of length 2^52 in Javascript.