🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #546

Re: subtraction between unsigned ints

#546
From: Walter Murray
Date: Thu, 07 Sep 1989 23:26
15 lines
1072 bytes
Doug Gwyn writes:

>In article <KURO.89Sep5111940@shochu.Sun.Com> 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
-------------
Technical Details
Message-ID: <12570023@hpclwjm.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!swrinde!ucsd!ucbvax!agate!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpclwjm!walter
References: <KURO.89Sep5111940@shochu.Sun.Com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <KURO.89Sep5111940@shochu.Sun.Com>
Organization: Hewlett-Packard Calif. Language Lab
Lines: 15