Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!sri-unix!BLARSON@ecld.#eclnet From: BLARSON@ecld.#eclnet Newsgroups: net.lang.c Subject: Re: New operator: /* Message-ID: <12859@sri-arpa.UUCP> Date: Sun, 26-Aug-84 20:10:31 EDT Article-I.D.: sri-arpa.12859 Posted: Sun Aug 26 20:10:31 1984 Date-Received: Thu, 30-Aug-84 19:59:05 EDT Lines: 26 From: Bob Larson There is no need for a temporary: d=((long)(a*b))/c; of course, both this and your example have the disadvantage of the conversion to long is done AFTER the multiply. Better would be: d= (long)a*b/c; where all computation is done in long. Best would be to specify optional (to compiler writer) optimization algorythms: Multiplying two ints resulting in long should use special opcode to do this where practical. Dividing a long by an int resulting in int should use special opcode where practical. Obviously this should also apply to int/short and short/char where applicable. Bob Larson -------