iterative integral division vs flooring

Benchmark created by Devyn Cairns on


Preparation HTML

<script>
  function div(a,b) {
    var i = 0;
    while (a >= b) { a = a - b; i ++; }
    return i;
  }
  
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
iterative
div(126000,65536);
ready
or zero
126000 / 65536 | 0;
ready

Revisions

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

  • Revision 1: published by Devyn Cairns on