BitXOR

From AutoIt Wiki

Jump to: navigation, search

Performs a bitwise exclusive OR (XOR) operation. Adapted from AutoIt docs.

Contents

[edit] Syntax

$x = BitXOR(value1,value2 [, value n])

[edit] Parameters

value1The first number.
value2The second number.
value nThe nth number - up to 255 values can be specified.(Optional)

[edit] Return Value

Returns the value of the parameters bitwise-XOR'ed together. Bit operations are performed as 32-bit integers.

BitXOR returns 1 in a bit position if there are an odd number of 1's in the corresponding bit position in all the input arguments, otherwise 0.

[edit] Example

$x = BitXOR(10, 6)  ;x == 12 because 1010b XOR 0110b == 1100
$x = BitXOR(2, 3, 6) ;x == 7 because 0010 XOR 0011 XOR 0110 = 0111

[edit] Related Functions

BitAND BitNOT BitOR BitShift Hex

Personal tools