Benchmark Math.floor

Benchmark created by Daniel Lamb on


Description

Find a faster way to run the Math.floor function.

Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
Math.floor(n)
var n0 = Math.floor(0.12341234);
var n1 = Math.floor(0.2);
var n2 = Math.floor(-3.1234);
var n3 = Math.floor(100000.23);
var n4 = Math.floor(2.12341234123412341324);
var n5 = Math.floor(100.0000000000000000001);
ready
~~n
var n0 = ~~0.12341234;
var n1 = ~~0.2;
var n2 = ~~ - 3.1234;
var n3 = ~~100000.23;
var n4 = ~~2.12341234123412341324;
var n5 = ~~100.0000000000000000001;
ready
n|n
var n0 = 0.12341234 | 0.12341234;
var n1 = 0.2 | 0.2;
var n2 = -3.1234 | -3.1234;
var n3 = 100000.23 | 100000.23;
var n4 = 2.12341234123412341324 | 2.12341234123412341324;
var n5 = 100.0000000000000000001 | 100.0000000000000000001;
ready
n&n
var n0 = 0.12341234 & 0.12341234;
var n1 = 0.2 & 0.2;
var n2 = -3.1234 & -3.1234;
var n3 = 100000.23 & 100000.23;
var n4 = 2.12341234123412341324 & 2.12341234123412341324;
var n5 = 100.0000000000000000001 & 100.0000000000000000001;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Daniel Lamb on
  • Revision 2: published by WebReflection on
  • Revision 3: published on