check for integer in a given range