Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
IE 11
Windows
Desktop
3 years ago
Test name Executions per second
floor 8563181.0 Ops/sec
~~ 29248514.0 Ops/sec
>> 0 32717310.0 Ops/sec
| 0 32844502.0 Ops/sec
<< 0 32065036.0 Ops/sec
& 0xFFFFFFFFFFFF 22390756.0 Ops/sec
^ 0x000000000000 32300348.0 Ops/sec
Math.trunc() 0.0 Ops/sec
x - (x % 1) 12375386.0 Ops/sec
parseInt() 8853821.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()