Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Sean1708
on March 23, 2018
|
parent
|
context
|
favorite
| on:
C for All
The "shifting" vs "multiplication" is just an optimisation since
x * 2 == x << 1
for any positive x. As far as I'm aware shifting a negative number is undefined, which will be why they use multiplication for negatives.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: