Mail Archives: djgpp/1999/02/28/07:20:53
On Sat, 27 Feb 1999, Paul Derbyshire wrote:
> Ack! Macros!
>
> const long double pi = 3.141592653589793
Don't ``invent'' Pi, use the constant M_PI.
> template <class F> // 'F' as in 'Floating point'
> inline F deg2rad (F deg) { return deg*pi/180.0; }
You don't need to go to C++ just to have inline functions.
> There. Nice and type-safe and free of bogons with arguments that have side
> effects.
The macros Nate suggested don't have any side effects.
- Raw text -