Is PI is #defined in <math.h>? Becuase it isn't with my compiler (Dev-c++ 4.0).
Although it is with DJGPP.
Printable View
Is PI is #defined in <math.h>? Becuase it isn't with my compiler (Dev-c++ 4.0).
Although it is with DJGPP.
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. :p
:eek: lolQuote:
Originally 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
:p
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.
:DCode:const double pi = 4. * atan(1.);