2

Why do bitwise operators (and, or) have a lower precedence than equals?!?! What is the reason?😨

I have checked it in Java and JS...

Comments
  • 2
    `1 == 0 | 1`
    What do you expect this to mean?
    It makes sense to be `1 == (1 | 0)`
    `(1== 0) | 1` won't even work in some strong typed languages
  • 2
    @ls-la That would make sense but Java has other stuff in mind... There it is
    (1 == 0) | 1
  • 0
    @OnlyBytes
    Lol! I read that fast, I thought you meant the opposite. Python and Ruby seem to be doing these operations expectedly though.
Add Comment