Function or

Logical or. Test if at least one value is defined with a nonzero/nonempty value. For matrices, the function is evaluated element wise.

Syntax

or(x, y)

Parameters

Parameter Type Description
x number | BigNumber | Complex | Unit | Array | Matrix First value to check
y number | BigNumber | Complex | Unit | Array | Matrix Second value to check

Returns

Type Description
boolean | Array | Matrix Returns true when one of the inputs is defined with a nonzero/nonempty value.

Examples

or(2, 4);   // returns true

a = [2, 5, 0];
b = [0, 22, 0];
c = 0;

or(a, b);   // returns [true, true, false]
or(b, c);   // returns [false, true, false]

See also

and, not, xor