Rewrite numor, numand, and numxor to handle BigIntegers.