Run details:
Mozilla/5.0 (Linux; Android 12; XQ-BC62) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36
Chrome Mobile 100
Android
Mobile
2 years ago
Test name Executions per second
floor 2645943.8 Ops/sec
~~ 4704152.0 Ops/sec
>> 0 4702088.0 Ops/sec
| 0 4714966.0 Ops/sec
<< 0 4724578.0 Ops/sec
& 0xFFFFFFFFFFFF 4718220.0 Ops/sec
^ 0x000000000000 4651517.5 Ops/sec
Math.trunc() 2651157.0 Ops/sec
x - (x % 1) 2941126.5 Ops/sec
parseInt() 2669927.2 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()