X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Sun, 17 Feb 2002 11:12:20 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: allegro and math libraries In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 17 Feb 2002, Brent Ritchie wrote: > Just a suggestion, you shouldn't rely on *magic* numbers like 3.1415. In my > opinion it's not good practice. I use this method. > > const float pi = (atan(1)*4); Fortran legacy, I suppose ;-) I don't recommend to put such a great faith into the quality of the `atan' library function: you'd be surprised how much some of them suck, and will give you inaccurate results. (The DJGPP version is okay, though.) Also, using integer "1" (without a period to signal a double) here is dangerous: it will do evil things if you forget to include . So it is much better to use a provided symbol M_PI, which is exact, and also saves some run-time computation. M_PI is defined on . The only downside is that M_PI isn't ANSI.