Run details:
Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1
Mobile Safari 16
iOS 16.6
Mobile
9 months ago
Test name Executions per second
Math.ceil(test) 7396332.5 Ops/sec
~~test 18396800.0 Ops/sec
Math.floor(test) 7058273.0 Ops/sec
Math.floor(test) + 1 (CEIL) 7229131.5 Ops/sec
FAST CEIL 18124190.0 Ops/sec
Script Preparation code:
Tests:
  • Math.ceil(test)

  • ~~test

  • Math.floor(test)

  • Math.floor(test) + 1 (CEIL)

  • FAST CEIL