Run details:
Mozilla/5.0 (Linux; Android 12; SM-N9750) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36
Chrome Mobile 103
Android
Mobile
2 years ago
Test name Executions per second
floor 1949900.1 Ops/sec
~~ 3553686.8 Ops/sec
>> 0 3533007.0 Ops/sec
| 0 3543433.8 Ops/sec
<< 0 3547109.5 Ops/sec
& 0xFFFFFFFFFFFF 3496214.0 Ops/sec
^ 0x000000000000 3425127.8 Ops/sec
Math.trunc() 1943329.2 Ops/sec
x - (x % 1) 2167155.8 Ops/sec
parseInt() 1880901.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()