Game Development Community

1 && 8) != (8 && 1)

by Orion Elenzil · in Torque Game Engine · 02/06/2006 (4:14 pm) · 1 replies

Woah..

echo((8 && 2) == (2 && 8));
0


this is because (A && B)
is evaluating as
if (A AND B) then answer B, else answer 0.

TGE 1.3


edit: sorry about the messed up parens in the title..

edit: changed "1"s to "2"s.

#1
02/06/2006 (4:25 pm)
But note that the following does return the expected value of 1:
echo (!!(8 && 2) == !!(2 && 8));
1