Fastest way to check even/odd

Benchmark created on


Setup

function isOddModulo(i) {
	return i % 2 === 1;
}

function isOddBit(i) {
	return i & 1 === 1;
}

Test runner

Ready to run.

Testing in
TestOps/sec
%
isOddModulo(4);
isOddModulo(5);
ready
&
isOddBit(4);
isOddBit(5);
ready

Revisions

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