News for hackers. Stuff that matters.
Re:Binary search with confidence by mark-r on Monday March 07, 2022 @11:07AM (#30589436)
Yes, it's always the midpoint calculation. Everybody forgets that (low+high) could overflow. It's trivial to work around once you know - just replace mid=(low+high)/2 with mid=low+(high-low)/2.

There are no comments on this comment yet.