hi , all
i need use PI in program, but i can't get PI value,,,which file define it , thanks...
hi , all
i need use PI in program, but i can't get PI value,,,which file define it , thanks...
I think it's in math.h. The name is M_PI.
thanks very much
If there is no such constant in math.h, try this:
Code:#include <math.h> double pi = atan(1.0) * 4.0;
I'm not sure if PI is standard in C inside of the math.h file, but it's certainly in there on good ol' linux gcc:
Code:./math.h:# define M_PI 3.14159265358979323846 /* pi */