So, the correct way of calculating mid in a binary search is mid = low + ((high - low) / 2) in order to handle overflow errors.
mid
mid = low + ((high - low) / 2)
My implementati
Don Knuth's method works perfectly through a bitmask with no possibility of an overflow:
return (low & high) + ((low ^ high) >> 1)