Check if a number is between a min and max