Unnecessary Macros (was Re: Unnecessary Parenthesis)
Rob Carriere
rob at phao.eng.ohio-state.edu
Thu Oct 6 03:05:28 AEST 1988
In article <12546 at oberon.USC.EDU> english at stromboli.usc.edu (Joe English)
writes:
>In article <701 at accelerator.eng.ohio-state.edu> rob at kaa.eng.ohio-state.edu
>(Rob Carriere) writes:
>>I *don't* want to write [in some inner loop]
>>foo = sin( x )*sin( x ) + 1.7;
>Why not? Unless you're using square() for legibility, the macro
>expansion is going to be sin(x) * sin(x) anyway.
That was the point of the original discussion. Needlessly evaluating
transcendental functions twice is generally frowned upon in numerical
circles.
Rob Carriere
More information about the Comp.lang.c
mailing list