Its because they don&#x27;t do the same thing<p>Math.floor() favors the number equal to&#x2F;less than the parameter, Math.floor(-15.5) is -16 while (-15.5 | 0) is -15<p>Also because the returned value is int32[0],<p>Math.floor(2147483648.5) is 2147483648 while (2147483648.5 | 0) is -2147483648<p>You are fine if you know the input is less than (2^31) + 1 and you want to truncate, rather than floor.<p>[0]: <a href="http:&#x2F;&#x2F;www.ecma-international.org&#x2F;ecma-262&#x2F;6.0&#x2F;#sec-binary-bitwise-operators-runtime-semantics-evaluation" rel="nofollow">http:&#x2F;&#x2F;www.ecma-international.org&#x2F;ecma-262&#x2F;6.0&#x2F;#sec-binary-b...</a>