Test case name | Result |
---|---|
floor | |
~~ | |
>> 0 | |
| 0 | |
<< 0 | |
& 0xFFFFFFFFFFFF | |
^ 0x000000000000 | |
Math.trunc() | |
x - (x % 1) | |
parseInt() |
Test name | Executions per second |
---|---|
floor | 4055907.5 Ops/sec |
~~ | 5658052.0 Ops/sec |
>> 0 | 5565977.5 Ops/sec |
| 0 | 5528512.0 Ops/sec |
<< 0 | 5524293.0 Ops/sec |
& 0xFFFFFFFFFFFF | 5366570.5 Ops/sec |
^ 0x000000000000 | 5007286.0 Ops/sec |
Math.trunc() | 3160662.8 Ops/sec |
x - (x % 1) | 2532486.5 Ops/sec |
parseInt() | 2728165.8 Ops/sec |