or

(boolean or boolean) 🡒 boolean, const autodiff operator

The keyword or is the logical OR operator.

table T = with
  [| as A,  as B  |]
  [| false, false |]
  [| false, true  |]
  [| true,  false |]
  [| true,  true  |]

show table "" a1b4 with
  T.A
  T.B
  T.A or T.B

The code above outputs the following table:

A B (T.A or T.B)
False False False
False True True
True False True
True True True

Advanced remark: If one of the expressions evaluates to true, it is unspecified whether the other expression will be evaluated or not. For example, the following code might or might not raise a division-by-zero warning, but will always print true:

a = 10
b = 0

// true
show scalar "Test" with b <= 0 or a / b > 0

See also

User Contributed Notes
0 notes + add a note