xHarbour Reference Documentation > Function Reference |
Performs a bitwise NOT operation with a numeric integer value.
HB_BitNot( <nInteger> ) --> nResult
The function returns a numeric value. It is the result of the bitwise NOT operation with the bits of the parameter.
The function performs bitwise NOT operation with the bits of the passed parameter. That is, all bits are inverted.
See also: | HB_BitAnd(), HB_BitIsSet(), HB_BitOr(), HB_BitXOr() |
Category: | Bitwise functions , xHarbour extensions |
Source: | rtl\hbBitf.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows the result of a bitwise NOT operation PROCEDURE Main LOCAL i FOR i := -5 TO 5 ? i, HB_BitNot(i) NEXT ** Output // -5 4 // -4 3 // -3 2 // -2 1 // -1 0 // 0 -1 // 1 -2 // 2 -3 // 3 -4 // 4 -5 // 5 -6 RETURN
http://www.xHarbour.com