HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by krzat | Hacker News Reader
Parent
Full thread
krzat
·
Why not `x / 16`?
View on HN
sheldor
·
Integer division will give a rounded result instead of floor
jskkk
·
Not in C..?
thechao
·
(x + 15) / 16
sp332
·
I think they're going for the ceiling here, not the floor. Truncation of positive values should be the same as a floor function.
kutkloon7
·
Yes, I wrote the example. Then realized it was different and corrected only half of it.
jskkk
·
Yes, which is more readable and would be compiled to the same thing
Reply on news.ycombinator.com