News for hackers. Stuff that matters.
Re:Mean of two floating point numbers can be dangerous by luc4sdreyer on Sunday June 05, 2016 @02:55PM (#11842449)
Reminds me of the way Java's binary search computes the average:

  int mid = (low + high) >>> 1;
This was a fix because the original code had a bug:

  int mid =(low + high) / 2;
Which was part of the Java code base for many years. Joshua Bloch based the code on Programming Pearls, which also contained the bug.

More info: https://research.googleblog.com/2006/06/extra-extra-read-all...

There are no comments on this comment yet.