0
Identity low of logic
Good day, I need help with some boolean algebra. I don't really know much, and my friends are having a hard time. If someone can help, here's the question thing. Identity low of logic: A || (A && B) =A
4 odpowiedzi
+ 2
The bracket part comes first A&&B which is B then we have A||B which will give you A, because the || only check for the first occurrence of true value
+ 2
Btw.: These things differ between languages.
It's one of the things you can look up whenever you're not sure.
The keyword for regoogling it every time or printing it out as a cheat sheet once is:
operator precedence!
+ 2
~ swim ~, the basic logic of && and || may be the same, but in the details there are a lot of differences when it comes to writing actual conditions and they get a bit longer.
Just compare the two lists of what is evaluated when and in which direction for C and Python ... it's tricky, to say the least.
https://docs.python.org/3/reference/expressions.html
https://en.cppreference.com/w/c/language/operator_precedence