Article View: comp.std.c
Article #552Re: subtraction between unsigned ints
From: Doug Gwyn
Date: Sat, 09 Sep 1989 01:26
Date: Sat, 09 Sep 1989 01:26
15 lines
1386 bytes
1386 bytes
In article <12570023@hpclwjm.HP.COM> walter@hpclwjm.HP.COM (Walter Murray) writes: -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. Yes, I was trying to put it succinctly. What I described was strictly accurate only for arithmetic types that don't undergo the usual arithmetic conversions when combined with other operands of their own type. Unsigned int is one of those.
Technical Details
Message-ID:
<10996@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwynReferences:
<KURO.89Sep5111940@shochu.Sun.Com> <12570023@hpclwjm.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: subtraction between unsigned ints Message-ID: <10996@smoke.BRL.MIL> Date: 9 Sep 89 01:26:51 GMT References: <KURO.89Sep5111940@shochu.Sun.Com> <12570023@hpclwjm.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15