Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Firefox 50
Linux
Other
8 years ago
Test name Executions per second
Math.floor 65950652.0 Ops/sec
Modulo 44344540.0 Ops/sec
Script Preparation code:
AخA
 
var v = Math.random() * 100;
var t;
Tests:
  • Math.floor

     
    t = v - Math.floor(v);
  • Modulo

     
    t = v % 1;