Xor: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(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 '...")
 
No edit summary
Line 31: Line 31:


[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[or|OR]]
[[and|AND]], [[eqv|EQV]], [[imp|IMP]], [[not|NOT]], [[or|OR]]
[[Category:Language Reference]]
[[Category:Logical Operators]]

Revision as of 15:29, 7 August 2012

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