What's the most effective way to validate an input if it's digit (includes negative digits as well)? The isdigit function checks only positive digits.