Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101 Firefox/107.0
Firefox 107
Windows
Desktop
2 years ago
Test name Executions per second
floor 204991520.0 Ops/sec
~~ 191107376.0 Ops/sec
>> 0 201242784.0 Ops/sec
| 0 216758304.0 Ops/sec
<< 0 212873952.0 Ops/sec
& 0xFFFFFFFFFFFF 204898384.0 Ops/sec
^ 0x000000000000 202353072.0 Ops/sec
Math.trunc() 201352208.0 Ops/sec
x - (x % 1) 863780032.0 Ops/sec
parseInt() 24451144.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()