Defining constant as function result in header = bad idea?
<p>In a widely used include file in one of our projects we have these convenience constants:</p>

<pre><code>const double kPi        = asin(1.0) * 2.0;
const double kPiHalf    = asin(1.0);
const double kDeg2Rad = asin(1.0) / 90.0;
const double kRad2Deg = 90.0 / asin(1.0);
</code></pre>

<p>Is it a bad idea to use function results to calculate (precise) constants once at runtime?</p>

<p>Some recent crash dumps (on OS X) we've received look dodgy - they've got a stack frame with the address of the <code>const double kRad2Deg</code> line at a deep level though the crash occurs somewhere in the app way up the stack trace. Weird.</p>

<p>Does calling the math functions very early during the startup phase possibly screw up things?</p>

<p>I know we could just replace the function calls with constants but I'd like to understand the problem (if there is any) in general.</p>
