and another possible way:

Code:
if ($calc(X % 2) == 0) {
  ; is even
}


If it ain't broken, don't fix it!