EQUALS Comparison Operator

The == operator is a binary (infix) EQUALS comparison operator. The == operator expects either an integer or string right hand operand and either as integer or string left hand operand.

If the left hand operand is an integer and the right hand operand is a string, then the right hand operand is automatically coerced to an integer before the integer EQUALS comparison operator is applied.

If the left hand operand is a string and the right hand operand is an integer, then the right hand operand is automatically coerced to a string before the string EQUALS comparison operator is applied.

If the type of the left hand operand is the same as the type of the right hand operand (i.e. they are both integers or both strings), then the EQUALS operator matching the type is applied.

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.

XCASM comparison operators return either a 0 (if the comparison fails) or a 1 (if the comparison succeeds). This corresponds to the logical truth values used by XCASM, 0 for false and 1 for true. The logical AND, OR and NOT operators rely on 0 for false and non-zero for true.

e.g.
	0x1234 == 0x00F0			yields 0
	0x1234 == 0x1234			yields 1

	(0x1204 + 0x0052) == 0x1256		yields 1

	"fred" == 0				yields 0
	"fred" == "fred"			yields 1

	0 == "fred"				yields 1 (see explanation of coersion from strings to integers)
	1 == "fred"				yields 0

	"0" == "fred"				yields 0

	("fred_" + 0) == "fred_0"		yields 1
	("fred_" + "0") == "fred_0"		yields 1

	("0" + "0") == "00"			yields 1
	("0" +  0)  == "00"			yields 1
	( 0  + "0") == "00"			yields 1
	( 0  +  0)  == "00"			yields 0

	"00" == ("0" + "0")			yields 1
	"00" == ("0" +  0)			yields 1
	"00" == ( 0  + "0")			yields 0
	"00" == ( 0  +  0)			yields 0