I think Bin `extends` the variable to an Integer before displaying it? If the uppermost bit in the number is set, it will fill all the upper 24 bits with 1's as well, to represent -1 as an Integer. I had the same thing happen with Hex$() trying to display Double's. As soon as you set the 31st bit it fills the upper 32 bits with 1's, as part of displaying it (original data unchanged).
So you're SEEING -1, as 11111111111111111111111111111111, but that's because of the display technique. If you print value Shr 8 you'll notice it's 0 instead of having 8 0's at the top end.
And yes, again, it DOES work to do ~value, same as !value
So you're SEEING -1, as 11111111111111111111111111111111, but that's because of the display technique. If you print value Shr 8 you'll notice it's 0 instead of having 8 0's at the top end.
And yes, again, it DOES work to do ~value, same as !value