Short-circuit operators

IDCC-9
TitleUse short-circuit logical operators (&&, ||) only in conditional statements.
PriorityMandatory
Severity level6
DescriptionUse short-circuit logical operators (&&, \|\|) only in conditional statements. In other statements, you can use & or \| instead.
RationaleCompatibility, Completeness

Avoid:

test1 = a > b;
test2 = b < a.^2;

result = test1 || test2;

Above will not work for vector values for a and b. Use elementwise logical operator | instead.

Instead use:

result = test1 | test2;