Whole Integer Division (v7)

Revision 7 of this benchmark created on


Setup

"use asm";
    a = -1234
    b = 3

Test runner

Ready to run.

Testing in
TestOps/sec
Regular Division (no var)
-1234 / 3
ready
Math.floor (no var)
Math.floor(-1234 / 3)
ready
Double NOT (no var)
~~
(-1234 / 3)
ready
OR 0 (no var)
-1234 / 3 | 0
ready
Right Shift 0 (no var)
-1234 / 3 >> 0
ready
Subtract Remainder (no var)
(-1234 - (-1234 % 3)) / 3
ready
Regular Division
a / b
ready
Math.floor
Math.floor(a / b)
ready
Double NOT
~~
(a / b)
ready
OR 0
a / b | 0
ready
Right Shift 0
a / b >> 0
ready
Subtract Remainder
(a - (a % b)) / b
ready

Revisions

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