Function Reference


Performs a bitwise NOT operation.

BitNOT ( value )


value The number to operate on.

Return Value

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


Remember hex notation can be used for numbers.
Remember that in 2's-complement notation, BitNOT() is functionally equivalent to adding 1 and negating the result.
Also remember that NOT changes a 0 bit to 1 and vice-versa.


BitAND, BitOR, BitRotate, BitShift, BitXOR, Hex


#include <MsgBoxConstants.au3>

; Assign a Local variable the bitwise NOT operation of 5.
Local $iBitNOT1 = BitNOT(5)

#cs Comments:
        Note: "b" is the symbol for byte.

        Result is -6 because for 32-bit numbers
        +5 == 0000 0000 0000 0000 0000 0000 0000 0101b
        -6 == 1111 1111 1111 1111 1111 1111 1111 1010b
        and the first bit is signed

; Display the result.
MsgBox($MB_SYSTEMMODAL, "", $iBitNOT1)