delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/28/07:20:53

Date: Sun, 28 Feb 1999 14:19:17 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Paul Derbyshire <pderbysh AT usa DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: sin, cos ??
In-Reply-To: <3.0.6.32.19990227021519.0088c6f0@pop.globalserve.net>
Message-ID: <Pine.SUN.3.91.990228141859.5950P-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019