C
CBFalconer
Paul said:.... snip ...
Why this is all in comp.lang.c is beyond me, however I would like
to point out the following:
if (a < 0) a = -a;
does *NOT* necessarily force the integer variable a to be
non-negative (see if you can figure out how/why). ... snip ...
however
if (a > 0) a = -a;
will force it to the range INT_MIN .. 0. Thus this is the proper
operation when translating to text and extracting signs. The
result can now be fearlessly converted into an unsigned.