eliminate some boxing in parseWhole and gcd