Hi,
taken from the PD code section from Numerical Recipes Book for C from 1992, a macro is defined as follows:
This may be old-style, but are there any benefits today in testing for 0 to avoiding multiplies with 0.0 (for efficiency I suppose?).Code:#define SQR(a) ((sqrarg=(a)) = 0.0 ? 0.0 : sqrarg * sqrarg )
And why are the a-parameter assigned to sqrarg and not used directly in the expression?
Thanks!