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

Revision 135 of this benchmark created by Heavensrevenge on


Description

Rounding in all form possible

Setup

var result = 934815067337773 / 37;

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
Math.floor(result);
ready
Math.round
Math.round(result);
ready
parseInt
parseInt(result, 10);
ready
Bitwise |
result | 0;
ready
Bitwise
result >> 0
ready
Bitwise zf
result >>> 0
ready

Revisions

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