Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6vDJ5fWY5uEZaJFNi
8 lines
341 B
Plaintext
8 lines
341 B
Plaintext
The midpoint, with indices near the top of the int range (arithmetic only, no array allocated)
|
|
==============================================================================================
|
|
|
|
lo = 1,200,000,000 hi = 1,500,000,000
|
|
(lo + hi) / 2 = -797,483,648
|
|
lo + (hi - lo) / 2 = 1,350,000,000
|
|
(lo + hi) >>> 1 = 1,350,000,000
|