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


#1

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


#2

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)
!(false)
true

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


#3

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