Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!ucsdhub!ucsd!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Unnecessary Macros (was Re: Unnecessary Parenthesis) Message-ID: <8629@smoke.ARPA> Date: 5 Oct 88 04:14:49 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: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 20 In article <701@accelerator.eng.ohio-state.edu> rob@kaa.eng.ohio-state.edu (Rob Carriere) writes: >In article <8590@smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >>One wonders whether [the inability to define a square macro] is much of a >>problem. >How about the following, deep in some inner loop: >foo = square( sin( x )) + 1.7; Another silly example. I can't imagine a real algorithm that would want this computation in it. >temp = sin( x ); >foo = temp*temp + 1.7; >is clearly less legible. Most programmers wouldn't have any trouble with foo = sin(x); foo = foo*foo + 1.7; I agree that an exponentiation operator would be handy, but a "square" macro doesn't seem to help readability.