Funktionsreferenz

BitNOT

Performs a bitwise NOT operation.

BitNOT ( value )

 

Parameter

value The number to operate on.

 

Bemerkungen

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.

 

Siehe auch

BitAND, BitOR, BitShift, BitXOR, Hex

 

Beispiel



$x = BitNot(5)

#cs Comments:
    Result is -6 because for 32-bit numbers
    5 == 00000000000000000000000000000101 binary
    -6 == 11111111111111111111111111111010 binary
    and the first bit is signed
#ce