Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
Chrome 86
Windows
Desktop
3 years ago
Test name Executions per second
floor 747209.6 Ops/sec
~~ 1254207.6 Ops/sec
>> 0 1255823.1 Ops/sec
| 0 1231360.0 Ops/sec
<< 0 1264528.9 Ops/sec
& 0xFFFFFFFFFFFF 1330877.9 Ops/sec
^ 0x000000000000 1426937.2 Ops/sec
Math.trunc() 792746.2 Ops/sec
x - (x % 1) 1074141.9 Ops/sec
parseInt() 886769.7 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()