HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by pishpash | Hacker News Reader
Parent
Full thread
pishpash
·
That won't get you the middle, these are integer divisions.
View on HN
rntz
·
Yes, that's why I said: "but then I have to think about rounding error. Ugh." Because integer division rounds. (Or truncates, if you prefer.)
pishpash
·
Plus, an extra operation, at least compared to some of the shift-based fixes.
kazinator
·
Rouding error can be taken care of:
https://news.ycombinator.com/item?id=14908117
Reply on news.ycombinator.com