Modulo vs BitWise Operator

Benchmark created by Vikram on


Test runner

Ready to run.

Testing in
TestOps/sec
With modulo
function evenNumberChecker(someNumber){
  if(someNumber%2===0){
    return true;
  } else {
    return false;
  }
}
ready
Without modulo
function evenNumberChecker1(someNumber){
  if(!( someNumber & 1 )){
    return true; 
  } else {
    return false;
  }
}
ready

Revisions

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

  • Revision 1: published by Vikram on