Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36
Chrome 97
Windows
Desktop
3 years ago
Test name Executions per second
pow int 7705887.0 Ops/sec
** int 863538944.0 Ops/sec
* int 864982208.0 Ops/sec
pow float 7478578.5 Ops/sec
** float 856571840.0 Ops/sec
* float 863121920.0 Ops/sec
** bigint 3144323.5 Ops/sec
* bigint 784841.8 Ops/sec
Tests:
  • pow int

    AخA
     
    var tmp = Math.pow(6, 21);
  • ** int

     
    var tmp = 6 ** 21;
  • * int

     
    var tmp = 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6;
  • pow float

     
    var tmp = Math.pow(6.1, 21.1);
  • ** float

     
    var tmp = 6.1 ** 21.1;
  • * float

     
    var tmp = 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1 * 6.1;
  • ** bigint

     
    var tmp = 6n ** 21n;
  • * bigint

     
    var tmp = 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n * 6n;