Article View: comp.std.c
Article #3541Re: Integral promotion.
From: msb
Date: Sat, 17 Feb 1996 18:06
Date: Sat, 17 Feb 1996 18:06
15 lines
989 bytes
989 bytes
> > short test(short x1, short x2) {
> > short result;
> > result = x1 + x2;
>
> The addition operator "+" converts your short operands to ints.
No, just using their values does that. The operator + never sees
operands narrower than int. In the statement
x1;
the short is converted to int before being discarded.
--
Mark Brader, msb@sq.com | "Ah, determinism (likewise, forgetfulness) reigns."
SoftQuad Inc., Toronto | --Steve Summit
My text in this article is in the public domain.
Technical Details
Message-ID:
<4g55fl$avl@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4fstj7$2l6@solutions.solon.com> <4fvgvb$e0t@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: msb@sq.com Newsgroups: comp.std.c,comp.lang.c.moderated Subject: Re: Integral promotion. Date: 17 Feb 1996 12:06:45 -0600 Organization: SoftQuad Inc., Toronto, Canada Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4g55fl$avl@solutions.solon.com> References: <4fstj7$2l6@solutions.solon.com> <4fvgvb$e0t@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com