BitNOT

From AutoIt Wiki

Jump to: navigation, search

Performs a bitwise NOT operation, returning the 1's-complement of a value. Adapted from AutoIt docs.

Contents

[edit] Syntax

$x = BitNOT(value)

[edit] Parameters

valueThe value to be operated on.

[edit] Return Value

Returns the bitwise NOT of the value. Bit operations are performed as 32-bit integers.

2's-complement notation is equivalent to adding one to the value and then inverting the bit representation.

[edit] Example

$x = BitNOT(5) ; output -6
   ; 5 = 00000000000000000000000000000101(bin)
   ; -6 = 11111111111111111111111111111010(bin)
   ; and the first bit is signed


[edit] Related Functions

BitAND BitOR BitShift BitXOR Hex

Personal tools