Math.floor vs Math.round vs parseInt vs Bitwise (v64)

Revision 64 of this benchmark created on


Description

Rounding in all form possible

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
Math.floor("12px");
ready
Math.round
Math.round("12px");
ready
parseInt
parseInt("12px");
ready
Bitwise |
"12px" | 0;
ready
Bitwise >>
"12px" >> 0;
ready
Bitwise ~~
~~("12px");
ready
Bitwise <<
"12px" << 0;
ready

Revisions

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