Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
secondcoming
on April 28, 2023
|
parent
|
context
|
favorite
| on:
Beautiful branchless binary search
Most topics I've read/viewed on branchless stuff seems to boil down to doing arithmetic with bools. So your code above can be thought of as:
bool b = compare(begin[step], value); begin += (step * b);
Paul-Craft
on April 28, 2023
[–]
Yeah, I got that. That was the part u/2102922286's comment made click for me. I guess I just don't do enough low level stuff for that to be something that automatically occurs to me.
Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: