Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
JoeAltmaier
6 months ago
|
parent
|
context
|
favorite
| on:
Why is x & -x equal to the largest power of 2 that...
Carry. -x is ~x (not x) PLUS ONE
It's that carry that ripples through, making bits flip until it gets to that 'largest power of 2'
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
It's that carry that ripples through, making bits flip until it gets to that 'largest power of 2'