Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36
Chrome 54
Linux
Other
8 years ago
Test name Executions per second
Math.floor 1578044.8 Ops/sec
Modulo 3160677.5 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;