Run details:
Mozilla/5.0 (Windows NT 6.1; rv:53.0) Gecko/20100101 Firefox/53.0
Firefox 53
Windows 7
Other
7 years ago
Test name Executions per second
Outside 19017570.0 Ops/sec
Inside 11891630.0 Ops/sec
Outside with division 18768024.0 Ops/sec
Inside with division 11766370.0 Ops/sec
Tests:
  • Outside

    AخA
     
    var p = [1,2,4,8,16,32,64,128,256,512];
    for (var n=0;n<10;n++) {
            var s = (Math.floor(65*0.098)+65)*p[n];
    };
  • Inside

     
    for (var n=0;n<10;n++) {
            var s = (Math.floor(65*0.098)+65)*Math.pow(2,n);
    };
  • Outside with division

     
    var p = [1,2,4,8,16,32,64,128,256,512];
    for (var n=0;n<10;n++) {
            var s = (Math.floor(65/10.24)+65)*p[n];
    };
  • Inside with division

     
    for (var n=0;n<10;n++) {
            var s = (Math.floor(65/10.24)+65)*Math.pow(2,n);
    };