Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!bellcore!faline!ulysses!allegra!alice!ark From: ark@alice.UUCP Newsgroups: comp.lang.c Subject: Re: MSC C arithmetic Message-ID: <7178@alice.UUCP> Date: Fri, 14-Aug-87 16:47:10 EDT Article-I.D.: alice.7178 Posted: Fri Aug 14 16:47:10 1987 Date-Received: Sun, 16-Aug-87 07:40:55 EDT References: <8792@brl-adm.ARPA> <7976@mimsy.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 15 In article <7976@mimsy.UUCP>, chris@mimsy.UUCP writes: > > > total_bits = repeat_cnt * units * blksiz * 16.0 > > [produce unexpected results]. > > The second result is not so defensible; the 16.0 should modify the > entire operation so that it is done in double. Nope. This example should be parsed as total_bits = (((repeat_cnt * units) * blksiz) * 16.0); Thus the first two multiplications should be done in integer, and the resulted converted to double for the third multiplication.