Xor

From NSB App Studio
Revision as of 21:23, 8 July 2012 by Brendon (talk | contribs) (Created page with "''result'' = ''x'' XOR ''y'' '''Description''' XOR returns the logical, exclusive disjunction of two expressions. ''result'' is TRUE, if and only if one of the expressions '...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

result = x XOR y

Description

XOR returns the logical, exclusive disjunction of two expressions. result is TRUE, if and only if one of the expressions x and y evaluate to TRUE, otherwise, result is FALSE.

Example

REM XOR Example
'XOR performs exclusive disjunctions
DIM Test1, Test2, x, y
x = 2
y = 9
Test1 = x > 0 XOR y < 10
Test2 = x > 0 XOR y > 10
PRINT "Logical:"
PRINT "  x > 0 XOR y < 10 = " & CSTR(Test1)
PRINT "  x > 0 XOR y > 10 = " & CSTR(Test2)

Output

Logical:
  x > 0 XOR y < 10 = False
  x > 0 XOR y > 10 = True

Related Items

AND, EQV, IMP, NOT, OR