pi (3.14...)

Started by
3 comments, last by flangazor 18 years, 7 months ago
How do I get the value of pi in c++ fast and efficiently? Is there a built in variable for it? Thanks.
Advertisement
just define your own variables :)

const double pi = 3.1415926535897932384626433832795;
const double pi2 = 6.283185307179586476925286766559;
my-eulogy - A blog about coding and gfxsdgi - Semi-Daily Game IdeaChunkyHacker - Viewer for Relic chunky formats (used in DOW)
M_PI should be defined in Math.h
Quote:Original post by e-u-l-o-g-y
just define your own variables :)

const double pi = 3.1415926535897932384626433832795;
const double pi2 = 6.283185307179586476925286766559;


[smile]

also

static const double pi = 4 * atan ( 1 );
2.0*acos(0)

This topic is closed to new replies.

Advertisement