News for hackers. Stuff that matters.
Re:Nearly all binary search and merge sort implementations a... by jbarham on Monday January 30, 2012 @09:52PM (#3531596)
Nice to see that the Go gets it right:

        func Search(n int, f func(int) bool) int {
                // Define f(-1) == false and f(n) == true.
                // Invariant: f(i-1) == false, f(j) == true.
                i, j := 0, n
                for i < j {
                        h := i + (j-i)/2 // avoid overflow when computing h
                        // i ≤ h < j
                        if !f(h) {
                                i = h + 1 // preserves f(i-1) == false
                        } else {
                                j = h // preserves f(j) == true
                        }
                }
                // i == j, f(i-1) == false, and f(j) (= f(i)) == true  =>  answer is i.
                return i
        }
http://code.google.com/p/go/source/browse/src/pkg/sort/searc...
Re:Nearly all binary search and merge sort implementations a... by nknight on Monday January 30, 2012 @11:26PM (#3531857)
I expect at least one of the Go authors was well aware of this very incident (the Java breakage), it was fairly well publicized before Go ever saw the light of day.