Variable enters C function as nonzero, turns to zero inside by itself : <p>I'm debugging a piece of code and found that when I print out a variable prior to function execution it is nonzero. The same variable is then used as an input argument for a function, but when printing it out right at the beginning of that function it says it's zero. </p>

<p>Outside the function call it looks like this:</p>

<pre><code>printf("sigma_b_m: %f \n",sigma_b_m);
oprq_init(sigma_b_m, b_m, r_m, x, P);
</code></pre>

<p>Inside the function call I did the following:</p>

<pre><code>void oprq_init(const float sigma_b_m, const float b[3], const float r[3], float K[16], float P[256]) {`
    printf("sigma_b_m: %f \n",sigma_b_m);
}
</code></pre>

<p>I removed the rest of the function for clarity but the printf line is really at the very start of the function.</p>

<p>The output is then:</p>

<blockquote>
  <p>sigma_b_m: 0.001745<br>
  sigma_b_m: 0.000000</p>
</blockquote>

<p>Any idea how it now registers as zero rather than the 0.001745 it told me it was prior to going into the function?</p>
