Math.ceil and Math.floor replacement (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script>
  var x = 10,
      y = 7;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
Math.floor(x / y);
ready
Math.floor with parseInt
parseInt(x / y);
ready
Math.floor with bitwise or
(x / y) | 0;
ready
Math.ceil
Math.ceil(x / y);
ready
Math.ceil with parseInt
parseInt((x / y) + 1);
ready
Math.ceil with bitwise or ()
((x / y) + 1 | 0);
ready

Revisions

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