Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tzs
8 months ago
|
parent
|
context
|
favorite
| on:
Why is x & -x equal to the largest power of 2 that...
Note that this gives 0 when x == O. For applications where you need the largest power of 2 that divides x because you are going to actually divide x by that you may want to check for 0 first.
Join us for
AI Startup School
this June 16-17 in San Francisco!
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: