Documentation errors - bitNot

Sean Shao shaosean at hotmail.com
Thu Nov 24 20:37:57 EST 2005


The documentation for "bitNot" states:

"bitNot 1 -- evaluates to 0
bitNot 14 -- in binary: bitNot 1110; evaluates to 0001; converted to 1"

Both of those results are incorrect (well in theory they are correct, but 
not for 32-bit integers)..

bitNot 1     -- returns 4294967294  (which is -2)
bitNot 14   -- returns 4294967280  (which is -15)

The correct answers are returned using the bitwise operators posted last 
night. You can verify all your answers using your web browser and the 
following javascript

<script type="text/javascript">
document.write(~14);     // ~ bitNot
</script>

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/




More information about the use-livecode mailing list