Comment Comment by arconis987 This is my go-to implementation, but I make one little tweak. It’s very unlikely that you will overflow a long, but you can you guarantee that you’ll avoid overflow like this:mid = min + (max - min) / 2; parent arconis987 5 years ago
mid = min + (max - min) / 2;