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;
var a = Math.floor(2.9999);
Bitwise 2
var a = ~~2.9999;

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.

Comment form temporarily disabled.

Add a comment