Make sure a number is in range.