Script Preparation code:
x
 
var float = 0.123456789;
var fixes = [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000];
var fix = 2;
Tests:
  • Floar

     
    ~~(float * fixes[fix]) / fixes[fix];
  • toFixed

     
    +(float.toFixed(fix))
  • static mult

     
    ~~(float * 100) / 2;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Floar
    toFixed
    static mult

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0
Firefox 75 on Windows
View result in a separate tab
Test name Executions per second
Floar 76444720.0 Ops/sec
toFixed 6450464.5 Ops/sec
static mult 386902176.0 Ops/sec