gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] need help


From: Hellwig . Geisse
Subject: Re: [gnugo-devel] need help
Date: Thu, 05 Feb 2004 09:23:02 +0100 (CET)

> &&   logical AND
> ||   logical OR
> !    logical NOT
> 
> It may also help to know that 0 is FALSE, anything non-zero is TRUE
> and the result of a logical expression is 0 or 1.

Another important fact may be the evaluation order of logical
expressions: strictly from left to right, and skipping the
evaluation of operands if the result is already known (so-called
"shortcut evaluation", important if side effects are involved).

Example: a < 5 && f() == 7
If a < 5 then f is called (and its return value compared
against 7), but if a >= 5 then f is not even called.

Hellwig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]