So I'm writing a library and I want to define a constant that will have the value of pi. I was thinking of defining a static const float pi = 3.14; in a pi.h file.
However, I'm almost sure that's not the way to do it because I've read that you shouldn't define variables in header files.
Another way I thought was to declare an inline function that returns the value of pi but that's awkward to work with.
Another way (I think) is to put it in pi.cc compile it into the library and then use extern static const float pi; in whatever file you are using pi with and of course link those files with the library.
What's the best way of doing this? The standard library would probably define a macro but I think a constant is better.