Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site randvax.ARPA Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sdcrdcf!randvax!edhall From: edhall@randvax.ARPA (Ed Hall) Newsgroups: net.lang.c Subject: Re: integer *= float Message-ID: <1612@randvax.ARPA> Date: Thu, 5-Jan-84 22:38:13 EST Article-I.D.: randvax.1612 Posted: Thu Jan 5 22:38:13 1984 Date-Received: Sun, 8-Jan-84 04:47:01 EST References: <4759@decwrl.UUCP> Organization: Rand Corp., Santa Monica Lines: 22 ------------------------------ We have tried integer *= float with 5 different C compilers, and all of them convert the float before the multiplication: 1) PCC on the VAX, 2) CC on the PDP-11 (i.e., the Ritchie compiler), 3) the UniSoft C compiler on the CYB, 4) AZTEC C on the APPLE, 5) C-86 on the IBM PC (Computer Innovations). I've seen at least two cases where code was broken due to this counter-intuitive behavior. A `fix' to PCC is not particularly difficult (at least for the VAX); I have one, but won't post it until this question is settled. Thus, the VMS C compiler seems to be in the minority. If the Ritchie compiler is considered to be the `reference', then it would seem that C does the counter-intuitive thing. But reading the appropriate part of K&R numerous times leaves me with the clear impression that the conversion belongs after the operation and before the store. -Ed Hall decvax!randvax!edhall