Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
borkabrak
on June 8, 2012
|
parent
|
context
|
favorite
| on:
(x / 2) or (x >> 1)?
In my work, it's generally better to optimize for clarity rather than performance. I suspect this is true more and more as compilers grow in sophistication. In this vein, use:
x = x / 2
To DIVIDE, use the DIVISION operator.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
x = x / 2
To DIVIDE, use the DIVISION operator.