Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!nrl-cmf!ukma!gatech!gitpyr!edp From: edp@pyr.gatech.EDU (Warren Tucker) Newsgroups: comp.lang.c Subject: Re: Unnecessary Macros (was Re: Unnecessary Parenthesis) Message-ID: <6500@pyr.gatech.EDU> Date: 4 Oct 88 22:08:48 GMT References: <2089@ssc-vax.UUCP> <441@kaon.uchicago.edu> <1401@devsys.oakhill.UUCP> <23@datcon.UUCP> <8577@smoke.ARPA> <8078@haddock.ima.isc.com> <8590@smoke.ARPA> <701@accelerator.eng.ohio-state.edu> Reply-To: edp@pyr.UUCP (Warren Tucker) Organization: Georgia Institute of Technology Lines: 17 In article <701@accelerator.eng.ohio-state.edu> rob@kaa.eng.ohio-state.edu (Rob Carriere) writes: >How about the following, deep in some inner loop: >foo = square( sin( x )) + 1.7; >I *don't* want to write: >foo = sin( x )*sin( x ) + 1.7; >and >temp = sin( x ); >foo = temp*temp + 1.7; >is clearly less legible. > >Rob Carriere It may be less legible to use 'temp' but sin(x)*sin(x) calculates the sine of x twice. -- Warren Tucker ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!edp