Reuse code in isXNumber() to avoid duplication and unneeded computations