Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118
Windows
Desktop
one year ago
Test name Executions per second
pow int 3036649.5 Ops/sec
** int 387686144.0 Ops/sec
* int 390524128.0 Ops/sec
pow float 3052499.0 Ops/sec
** float 392365792.0 Ops/sec
* float 390319840.0 Ops/sec
** bigint 1042951.6 Ops/sec
* bigint 391726048.0 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;