2 bitwise exclusive or operator, 3 bitwise inclusive or operator, 5 maxl logical operators – ElmoMC Multi-Axis Motion Controller-Maestro User Manual

Page 83: 1 logical and operator, Bitwise operators, Maxl logical operators

Advertising
background image

5.4.1.4.6.2 Bitwise Exclusive OR Operator

The bitwise exclusive OR operator (^) returns the bitwise exclusive OR of the two
operands. All bits that are on (1) in either the left or right operand, but not both, are on
in the result. Bits that are the same (either on or off) in both operands are off in the
result.

Syntax

exclusive-or-expression :

expression ^ expression

expression:

exclusive-or-expression

Both operands to the bitwise exclusive OR operator must be integer types.

5.4.1.4.6.3 Bitwise Inclusive OR Operator

The bitwise inclusive OR operator (|) returns the bitwise inclusive OR of the two
operands. All bits that are on (1) in either the left or right operand is on in the result.
Bits that are off (0) in both operands are off in the result.

Syntax

inclusive-or-expression :

expression | expression

expression:

inclusive-or-expression

Both operands to the bitwise inclusive OR operator must be integer types.

5.4.1.5

Maestro

Software Manual

MAXL Program Language

MAN-MASSW (Ver. Q)

MAXL Logical Operators

The logical operators, logical AND (&&) and logical OR (||), are used to combine
multiple conditions formed using relational or equality expressions.

5.4.1.5.1 Logical AND Operator

The logical AND operator (&&) returns the integer value 1 if both operands are
nonzero; otherwise, it returns 0. Logical AND has left-to-right associativity.

Syntax

logical-and-expression :

expression && expression

expression:

logical-and-expression

The operands to the logical AND operator must be integer types. The operands are
commonly relational or equality expressions. The first operand is completely
evaluated and all side effects are completed before continuing evaluation of the logical
AND expression.

5-21

Advertising