Hacker News new | ask | show | jobs
by robocat 3936 days ago
value | 0 will always return a 32 bit integer.

Math.floor(value) can return some weirder values such as: NaN (for anything that isn't a number), and Infinity, -Infinity, -0. And Math.floor(-1e-300); is -1 so care needs to be taken with floating values near zero.