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

Revision 62 of this benchmark created on


Description

Rounding in all form possible

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
Math.floor("123");
Math.floor(83784 / 9289.2);
Math.floor(7 / 60);
ready
Math.round
Math.round("123");
Math.round(83784 / 9289.2);
Math.round(7 / 60);
ready
parseInt
parseInt("123");
parseInt(83784 / 9289.2);
parseInt(7 / 60);
ready
Bitwise |
"123" | 0;
83784 / 9289.2 | 0;
7 / 60 | 0;
ready
Bitwise >>
"123" >> 0;
83784 / 9289.2 >> 0;
7 / 60 >> 0;
ready
Bitwise ~~
~~("123");
~~(83784 / 9289.2);
~~(7 / 60);
ready
Bitwise <<
"123" << 0;
83784 / 9289.2 << 0;
7 / 60 << 0;
ready

Revisions

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