الرئيسية > lang > xor 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr fa id vi ko ja ru zh zh_TW eo
السابق  التالي  تحرير  إعادة تسمية  تراجع  بحث  الإدارة  
المستندات  
تحذير! هذه الصفحة لم يتم ترجمتها.  See english version 
XOR
Result = Expression XOR Expression

Computes the logical exclusive or of two boolean expressions, or the numerical exclusive or of two integer numbers.

The logical XOR operator connects two boolean expressions and returns a true or false value. The results returned by this operation is shown in the following table:

A B A XOR B
FALSE FALSE TRUE
FALSE TRUE FALSE
TRUE FALSE TRUE
TRUE TRUE FALSE

The numerical XOR operator connects two integer values and returns an integer value. Each corresponding bit of the specified values are combined according to the following table:

A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

مثال

PRINT TRUE XOR FALSE

True

PRINT TRUE XOR TRUE

False

PRINT 7, Bin(7, 16)
PRINT 11, Bin(11, 16)
PRINT 7 XOR 11, Bin(7 XOR 11, 16)

7       0000000000000111
11      0000000000001011
12      0000000000001100

إنظر أيضا

Logical Operators