Two's complement: Difference between revisions

Added XPL0 example.
(Added XPL0 example.)
Line 219:
2147483646 -> -2147483646
2147483647 -> -2147483647
</pre>
 
=={{header|XPL0}}==
<lang XPL0>int I; char C;
[I:= 123;
I:= (~I) + 1;
IntOut(0, I); CrLf(0);
C:= -123;
C:= ~(C-1);
IntOut(0, C); CrLf(0);
]</lang>
 
{{out}}
<pre>
-123
123
</pre>
 
772

edits