Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed possible overflow error for large arrays in binary search. #1

Merged
merged 1 commit into from
Sep 30, 2011
Merged

Fixed possible overflow error for large arrays in binary search. #1

merged 1 commit into from
Sep 30, 2011

Conversation

mutexlox
Copy link
Contributor

(left+right)/2 can overflow in the case where, for example, left = 2 and right = 2^(32)-1. In that case, left + (right-left)/2 would not overflow.

duiker101 added a commit that referenced this pull request Sep 30, 2011
Fixed possible overflow error for large arrays in binary search.
@duiker101 duiker101 merged commit 12f6c6b into duiker101:master Sep 30, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants