Simplest way to see what a binary NOT does is to use the Windows Calculator in binary mode.
Simply, it reverses all the "1"s and "0"s. The really important thing to remember is that the size of the data type will determine how many places are reversed - play with the QWORD, DWORD, WORD and BYTE setting to see what I mean.
If you are using NOT in KiXtart you should use the largest data type to hold the number and then use binary AND to ensure that you get the right sized result. You can also force the data type using one of the Cxxx() functions if you know what it will be:
Code:
$iByteSize=&FF
$iWordSize=&FFFF
"Not 100 (BYTE) = " DecToHex((~100) & $iByteSize) ?
"Not 100 (WORD) = " DecToHex((~100) & $iWordSize) ?
"Not 100 (DWORD) = " DecToHex((~CDbl(100))) ?