In languages with fixed-size integers (C++, Java), low + high can overflow.
Example: low = 2^30, high = 2^30. Sum is , which overflows a signed -bit integer.
Fix: Use mid = low + (high - low) / 2. This is mathematically equivalent but avoids overflow.
Python note: Python integers have arbitrary precision, so overflow isn't a concern. But using the safe formula is good practice.
Alternative in some languages: Use unsigned integers or -bit integers. But low + (high - low) / 2 is the universal fix.