Whole Integer Division (v3)

Revision 3 of this benchmark created on


Setup

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
Math.trunc (no var)
Math.trunc(-1234/3)
ready
Math.trunc
Math.trunc(a/b)
ready

Revisions

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