Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
10 months ago
Test name Executions per second
floor 4566218.5 Ops/sec
~~ 8312922.5 Ops/sec
>> 0 8252641.0 Ops/sec
| 0 8270760.0 Ops/sec
<< 0 8071899.5 Ops/sec
& 0xFFFFFFFFFFFF 8134961.0 Ops/sec
^ 0x000000000000 8033402.5 Ops/sec
Math.trunc() 4403145.0 Ops/sec
x - (x % 1) 5580049.0 Ops/sec
parseInt() 4383770.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()