Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 OPR/98.0.0.0
Opera 98
Windows
Desktop
one year ago
Test name Executions per second
floor 7941839.0 Ops/sec
~~ 14451861.0 Ops/sec
>> 0 14568422.0 Ops/sec
| 0 14496718.0 Ops/sec
<< 0 14525053.0 Ops/sec
& 0xFFFFFFFFFFFF 14332578.0 Ops/sec
^ 0x000000000000 14307854.0 Ops/sec
Math.trunc() 7569096.5 Ops/sec
x - (x % 1) 9577617.0 Ops/sec
parseInt() 8293245.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()