Logical Operators

Revision as of 18:01, 2 February 2007 by Lchrisman (talk | contribs) (Defined full (ideal) semantics.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Logical operators are used to combine boolean assertions. Analytica uses the values True=1 and False=0.

When applied to values other than 0 or 1, other parameter values are interpreted as follows:

  • a non-zero numeric is treated as true
  • NaN is treated as ambiguous (could be 0 or 1)
  • Null is treated as a No-op
  • Undefined results in an undefined result (if the result is not fully determined by the other parameter)
  • Any other data type results in an error.

And

A And B

True if both A and B are true. False if either A or B is false.

In this table, x signifies a numeric value that is not equal to zero (and is not NaN).

And   0   x NaN Null Undefined
0 0 0 0 0 0
x 0 1 NaN 1 Undefined
NaN 0 NaN NaN NaN Undefined
Null 0 1 NaN Null Undefined
Undefined 0 Undefined Undefined Undefined Undefined

Or

A or B

True if A or B or both are true.

In this table, x signifies a numeric value that is not equal to zero (and is not NaN).

And   0     x   NaN Null Undefined
0 0 1 NaN 0 Undefined
x 1 1 1 1 1
NaN NaN 1 NaN NaN Undefined
Null 0 1 NaN Null Undefined
Undefined Undefined 1 Undefined Undefined Undefined

Not

Not   0     x   NaN Null Undefined
1 0 NaN Null Undefined
Comments


You are not allowed to post comments.