I had the task of finding a logical expression that would result in `1`

if and only if a given number `n`

is a multiple of `2019`

and is NOT from the interval `(a, b)`

.

教科书给出了以下答案，但我不太理解：

```
a>=n || b<=n && (n%3==0 && n%673==0)
```

The thing between those parantheses I understand to be equivalent to `n%2019==0`

, so that's alright. But I don't understand why this works, I mean the `&&`

operator has higher priority that the `||`

operator, so wouldn't we evaluate

`b<=n && (n%3==0 && n%673==0)`

first and only at the end if `n<=a`

? I thought that if I were to do it, I would do it like this:

`(a>=n || b<=n) && (n%3==0 && n%673==0)`

So I just added that extra set of parantheses. Now we would check if the number is not in the interval `(a, b)`

, then we would check if it is a multiple of `2019`

and then we would 'and' those to answers to get the final answer. This makes sense to me. But I don't understand why they omitted that set of parantheses, why would that still work? Shouldn't we consider that `&&`

has higher priority than `||`

, so we add an extra set of parantheses? Would it still work? Or is it me that is wrong?