div v mult

Benchmark created on


Setup

const rand = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);

const resDiv = rand / 2;
const multDiv = rand * 0.5;

let res;

if (resDiv === multDiv) {
	console.log(`OK`);
	res = resDiv;
	console.log(res);
};

Test runner

Ready to run.

Testing in
TestOps/sec
div
if ((rand / 2) != res) console.log(`NOT OK!`);
ready
mult
if ((rand * 0.5) != res) console.log(`NOT OK!`);
ready

Revisions

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