Is PI is #defined in <math.h>? Becuase it isn't with my compiler (Dev-c++ 4.0).
Although it is with DJGPP.
Is PI is #defined in <math.h>? Becuase it isn't with my compiler (Dev-c++ 4.0).
Although it is with DJGPP.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
No, you are looking for M_PI
Actually, I can't find anywhere in the standard that defines it, so you might have M_PI, but I wouldn't rely on it. #define your own? pi isn't likely to change in the near future.
Last edited by cwr; 09-07-2005 at 08:58 PM.
lolOriginally Posted by cwr
PI IS EXACTLY THREE!
(My attempt at starting a flame war)Code:#define PI 3
M_PI (like PI) is actually non-standard. But it is a somewhat common extension to math.h
Code:#define PI 3.141592653589793238462643383...
Yeah, I know how to get PI - just open a calculator and click on pi. But I thought PI was defined in <math.h>. I guess I'll just declare it myself.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Code:const double pi = 4. * atan(1.);