ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

constant M_PI is not supported
Posted by nikonoff (ONPU) 21 Aug 2009 13:30
FAQ says (for C++ compiler):
The constant M_PI is not supported. You have to define it yourself. For example, use const double PI = 2.0*acos(0.0).

This is not true. Such code is accepted:

#include <math.h>
#define _USE_MATH_DEFINES
...
printf ("%lf", M_PI);
...

May be FAQ should be corrected...
Nothing
Posted by OpenGL 21 Aug 2009 17:55


Edited by author 21.08.2009 17:57
Re: constant M_PI is not supported
Posted by nikonoff (ONPU) 31 Aug 2009 13:49

ooops...

#define _USE_MATH_DEFINES
#include <math.h>
...