subtraction between unsigned ints

Walter Murray walter at hpclwjm.HP.COM
Sat Sep 9 10:37:49 AEST 1989


Norman Diamond writes:

>>Does pANSI defines the datatype of the result of subtraction
>>between unsigned integers?  Would it be also unsigned?  Then
>>what would be the result of subtraction of a number from a
>>smaller number?

>It always has been unsigned, even in K&R days.  pANS says that the
>result must wrap around modulo some power of 2; this was not required
>by K&R but surely always occured.

I think it was required by K&R.  See Appendix A, section 6.5, in the
first edition (page 184).

Walter Murray
--



More information about the Comp.std.c mailing list