BitAND

From AutoIt Wiki

Jump to: navigation, search

Performs a bitwise AND operation. As per convention, BitAND returns a 1 iff the corresponding positions of each value are also 1.

Adapted from AutoIt docs.

Contents

[edit] Syntax

$x = BitAND(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-AND'ed together.

[edit] Example

$x = BitAND(13, 7) ;x = 5 because 1101 AND 0111 = 0101
$x = BitAND(2, 3, 6) ;x = 2 because 0010 AND 0011 AND 0110 = 0010


[edit] Related Functions

BitNOT BitOR BitShift BitXOR Hex

Personal tools