Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!swrinde!ucsd!ucbvax!agate!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter From: walter@hpclwjm.HP.COM (Walter Murray) Newsgroups: comp.std.c Subject: Re: subtraction between unsigned ints Message-ID: <12570023@hpclwjm.HP.COM> Date: 7 Sep 89 23:26:48 GMT References: Organization: Hewlett-Packard Calif. Language Lab Lines: 15 Doug Gwyn writes: >In article kuro@shochu.Sun.Com (Teruhiko Kurosaka - Sun Intercon) writes: >>Does pANSI defines the datatype of the result of subtraction >>between unsigned integers? Would it be also unsigned? >Yes, the type of the result of any arithmetic combination of operands >having a single arithmetic type is the same type as that of the operands. But note that the usual arithmetic conversions are still performed. So if s1 and s2 have type short int, for example, the expression (s1+s2) has type int, not short int. Walter Murray -------------