Implement the isdigit function

Implement the isdigit function as efficiently as you can..
How do you handle errors if you had to