Hacker News new | ask | show | jobs
by mattst88 5166 days ago
> So 5.4 | 0 will gives 5, which is a flooring operation. However, -5.4 will give -5. And that’s a ceiling operation.

So, | is actually doing a round toward zero. It seems like the problem described is actually caused by simply misunderstanding what the floor function does (round toward negative infinity).