Even or Odd? (v7)

Revision 7 of this benchmark created by Samuel Cousin on


Preparation HTML

<script>
  x = 238;
  y = 381;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Modulo ?:
var isEven1 = x % 2 == 0 ? true : false;
var isEven2 = y % 2 == 0 ? true : false;
ready
Bitwise AND ?:
var isEven1 = x & 1 == 0 ? true : false;
var isEven2 = x & 1 == 0 ? true : false;
ready

Revisions

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

  • Revision 7: published by Samuel Cousin on