Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: long conversion of short expression. Message-ID: <10625@smoke.BRL.MIL> Date: 30 Jul 89 10:49:14 GMT References: <9092@chinet.chi.il.us> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 10 In article <9092@chinet.chi.il.us> pdg@chinet.chi.il.us (Paul Guthrie) writes: >In the following code segment, the two shorts multiplied together >exceed the size of a short, but the question is, is the result >of the multiplication really a short to be converted to a >long, or a long already? Arithmetic operators that have the same arithmetic type for their operands always produce the same type for the result. If you want the result to be a different type, convert at least one of the operands via a cast before applying the arithmetic operator.