Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!sri-unix!gwyn@BRL-VLD.ARPA From: gwyn@BRL-VLD.ARPA Newsgroups: net.lang.c Subject: Re: New operator: /* Message-ID: <12864@sri-arpa.UUCP> Date: Mon, 27-Aug-84 03:09:36 EDT Article-I.D.: sri-arpa.12864 Posted: Mon Aug 27 03:09:36 1984 Date-Received: Thu, 30-Aug-84 20:01:08 EDT Lines: 11 From: Doug Gwyn (VLD/VMB) Try short a, b, c, d; d = (long)a * b / c; The one typecast is sufficient to force all the arithmetic to be done with long arithmetic, then the result is coerced back into short on assignment to `d'. If your compiler is sufficiently clever, it will take advantage of the fact that the result of the division is only needed as a short; in any case it is obligated to return the correct answer.