Mail Archives: djgpp/1998/12/18/04:56:17
A better way would be to calculate pi once by eg
double pi = 4 * atan(1.0);
it should give you pi in a precision suitable for the
math library.
Just my two cents ..
Anton Helm wrote:
>
> At 18:27 17.12.98 +0000, Arthur wrote:
>
> >I think in math.h, there is a definition called PI. This is much more
> >accurate than what you've got here.
> >
> >So you can use sin(x*PI/180); instead (easier).
> >
>
> PI is not ANSI (checked) and as far as I know
> it isn't POSIX either (unchecked).
>
> So if you want a portable code you should
> have a
>
> #ifndef PI
> #define PI 3.1415.....
> #endif
>
> somewhere (well, preferably in a *.h file) in your program.
>
> Although PI and M_PI are #defined on lots of systems you
> can't rely on them.
>
> Tony
- Raw text -