Logical AND Operator

The && operator is a binary (infix) logical AND operator. This should not be confused with the & operator which is a bitwise AND operator. The && operator expects an integer right hand operand and an integer left hand operand. If either operand is a string, it will be automatically coerced to an integer before the AND operator is applied. Furthermore, each operand must be a boolean value where zero has the meaning false and non-zero has the meaning true.

Logical operators can only return 0 for false and 1 for true even though they accept non-zero for true.

BEWARE:

Unlike the 'C' language logical && operator the XCASM logical && operator is not an early-out operator i.e. the && operator cannot be used as a guard in an expression

 

syntax:

	<left_expr> && <right_expr>

<left_expr> and <right_expr> are refered to as the left and right operand respectively and may themselves be simple values or complex expressions.

e.g.
	0 && 0					yields 0
	1 && 0					yields 0
	0 && 1					yields 0
	1 && 1					yields 1

	   0 &&  0				yields 0
	  -1 &&  0				yields 0
	   0 &&  1				yields 0
	 -15 && -17				yields 1

	0x1234 && 0x00F0			yields 1
	0x1234 && 0x00E0			yields 1

	(0x1204 == 0x0051) && 0x00F0		yields 0
	(0x1204 >  0x0051) && 0x00F0		yields 1