Tests whether character is digit or not.