Hmmmm..........................What is this?


Hey guys, can anybody explain the following code:
!(false && (!false))?


Ok, so lets start. Inside !(false && (!false)) we have a bool value and two operators. Value is false, and operators are ! and &&, representing negation NOT and logical AND.

Now, ! will negate our value, but we should ignore the first one for now. AND will give true if we pair true and true, and false in other combinations (false && true, true && false, false && false).

So, here is the calculation

!(false && (!false))
!(false && true)

And this will evaluate into true. If this explanation is not what you were after, feel free to ask more in detail.


Thx, nice explanation. This really helps me :smiley: