02.02.2011, 05:03
here is my quick test
and reading up about it it takes the binary number and inverts the bits (ie 1010101 would become 0101010)
and then adds one
its seems to be a way or storing negitive numbers in binary
pawn Код:
printf("%d",~1);
result:-2
printf("%d",~2);
result:-3
printf("%d",~3);
result:-4
printf("%d",~4);
result:-5
printf("%d",~5);
result:-6
printf("%d",~10);
result:-11
printf("%d",~100);
result:-101
printf("%d",~1000);
result:-1001
printf("%d",~10000);
result:-10001
printf("%d",~100000);
result:-100001
and then adds one
its seems to be a way or storing negitive numbers in binary