negative bits
Claus Dreischer
claus at dreischer.de
Wed Apr 2 10:10:14 EDT 2008
Hi,
maybe someone has done this already ...
I'd like to convert integers into binary ones and zeros like
input: "9" -> output "1001" or depending on the size of the output: "00001001"
This can be done with the baseConvert function:
baseConvert( 9, 10, 2 ) gets me my "1001"
BUT (and we finaly get to the point)
converting a *negative* integer number won't get me the desired result:
baseconvert( -9, 10, 2 ) -> "-1001"
The anticipated result would be "11110111"
So, how do i get there?
Am i missing something?
Regards,
Claus.
More information about the use-livecode
mailing list