Math.round vs hack (v39)

Revision 39 of this benchmark created on


Preparation HTML

<script>
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
"proper" rounding
var fValue = 0.6;
var iValue = Math.round(fValue);
ready
Hack rounding
var fValue = 0.6;
var iValue = (0.5 + fValue) >> 0;
ready

Revisions

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