Math.floor(x); vs Math.round(x) vs (0.5 + x) << 0; | Test case name | Result |
|---|---|
| Math.floor(x); | |
| Math.round(x) | |
| (0.5 + x) << 0; |
| Test name | Executions per second |
|---|---|
| ✓ Math.round(x) | 352,376,544 Ops/sec |
| Math.floor(x); | 349,444,768 Ops/sec |
| (0.5 + x) << 0; | 347,423,904 Ops/sec |