Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36
Chrome 128
Windows
Desktop
3 months ago
Test name Executions per second
floor 3235536.5 Ops/sec
~~ 5156283.5 Ops/sec
>> 0 5147545.5 Ops/sec
| 0 5136597.5 Ops/sec
<< 0 5178273.0 Ops/sec
& 0xFFFFFFFFFFFF 5058300.5 Ops/sec
^ 0x000000000000 5149367.0 Ops/sec
Math.trunc() 3265526.2 Ops/sec
x - (x % 1) 3748596.2 Ops/sec
parseInt() 3192660.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()