Checks if a value is in a range (inclusive)