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

Syntax

$x = BitNOT(value)

Parameters

valueThe value to be operated on.

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.

Example

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


Related Functions

BitAND BitOR BitShift BitXOR Hex

Personal tools