I am writing a program in C using XCode. I don't use C much, usually I use C++. I've never used XCode before.
Compile error is quite simple, the following lines of code are not being treated as compile time constants by the compiler.
const double PI = 4.0 * atan(1.0);
const double TAU = 8.0 * atan(1.0);
I'm sure this is allowed in C++ 11, although I can't be certain, since I last used it some months ago.
My guess is that the XCode compiler / the C standard does not allow constants to be computed in this way.
Is there an alternative I can use? I don't much fancy the "define" alternative...
#define PI 4.0 * atan(1.0);
As this will (may?) cause unnecessary run-time overhead.