floor_f2 implementations

Benchmark created on


Setup

function floor_f2_parseInt(num)
{
	return parseInt(num*100)/100.0;
}

function floor_f2_Mathtrunc(num)
{
	return Math.trunc(num*100)/100.0;
}

function floor_f2_floor(num)
{
	return Math.floor(num*100)/100.0;
}

Test runner

Ready to run.

Testing in
TestOps/sec
parseInt
let a = Math.random();
for(let i = 0; i < 1000; i++) {
	floor_f2_parseInt(a);
}

ready
trunc
let a = Math.random();
for(let i = 0; i < 1000; i++) {
	floor_f2_Mathtrunc(a);
}
ready
floor
let a = Math.random();
for(let i = 0; i < 1000; i++) {
	floor_f2_floor(a);
}
ready

Revisions

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