Number floring

JavaScript performance comparison

Test case created

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Bitwise 1
var a = 2.9999 << 1 >> 1;
pending…
Math
var a = Math.floor(2.9999);
pending…
Bitwise 2
var a = ~~2.9999;
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

1 comment

Sam T commented :

Just wanted to notify that both bitwise operations causes a dialog about stopping scripts in IE8 and IE8 Compat. The Math.Floor() goes on without such warnings.

Add a comment