Date: Sun, 28 Feb 1999 15:36:04 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: sin, cos ?? In-Reply-To: <3.0.6.32.19990228081852.008acda0@pop.globalserve.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Sun, 28 Feb 1999, Paul Derbyshire wrote: > 1. M_PI is a macro. So are stdin and stdout. If you want to avoid macros, you won't get very far. > 2. That value is accurate to the last decimal place, anyways. At the moment it was written, maybe, and for the machine it was written on. But code tends to live longer than its writers ever imagine. What's good today, might be bad tomorrow (e.g., if double becomes 80 bits). > >The macros Nate suggested don't have any side effects. > > Well, those specific ones don't, as it just so happens, as long as you > don't pass something pathological as argument No, they don't have any side-effects, period. Nate took all the precautions that are needed to that the macros will work with any pathological arguments. > but macros on the whole are best avoided. You sound like the "goto considered harmful" argument of yore. Nothing should be brought ad absurdum. Macros should be avoided *when* they are dangerous, and if there's a better tool to achieve the same goal. Otherwise, they are a tool that has its advantages, if used wisely. I have yet to see a non-trivial program which doesn't use macros (and goto's).