floor (v6)

Revision 6 of this benchmark created by CodeHunger on


Preparation HTML

<script>
  var x = Math.PI,
      y;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
y = Math.floor(x);
ready
bitwise or
y = 0 | x;
ready
left bitshift
y = x << 0;
ready
right bitshift
y = x >> 0;
ready
not not
y = ~~x;
ready
bitwise or 2
y = x | x
ready
Parse int
y = parseInt(x)
ready
Parse int with radix
y = parseInt(x, 10)
ready

Revisions

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