Even Number Detection

Benchmark created by Regina on


Description

What is the fastest way to detect if a number is even or odd?

Setup

function isEvenMod(n) { return n%0 === 0; }
    
    function isEvenBit(n) { return 1&n === 0; }

Test runner

Ready to run.

Testing in
TestOps/sec
Mod
isEvenMod(5);
ready
Bit
isEvenBit(5);
ready

Revisions

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