test if result is in range