-
-
Save ttsugriy/df69ba55a57f64b2ddc591975aa90de8 to your computer and use it in GitHub Desktop.
midpoint experiments for bench
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int midpointb(int l, int r) { | |
return (l + r) >> 1; | |
} | |
int midpointw(int l, int r) { | |
return l + (r - l) / 2; | |
} | |
int midpoint(int l, int r) { | |
return static_cast<unsigned int>(l) + static_cast<unsigned int>(r) >> 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment