5 comments

[ 2.2 ms ] story [ 26.4 ms ] thread
Why does this happen?
it's a signed int... ones' complement.
Indeed, if you want 0/1, use unsigned int, not signed int!