<p>So I have a function that looks something like this:</p>

<pre><code>float function(){
    float x = SomeValue;
    return x / SomeOtherValue;
}
</code></pre>

<p>At some point, this function overflows and returns a really large negative value.  To try and track down exactly where this was happening, I added a cout statement so that the function looked like this:</p>

<pre><code>float function(){
    float x = SomeValue;
    cout &lt;&lt; x;
    return x / SomeOtherValue;
}
</code></pre>

<p>and it worked!  Of course, I solved the problem altogether by using a double.  But I'm curious as to why the function worked properly when I couted it.  Is this typical, or could there be a bug somewhere else that I'm missing?</p>

<p>(If it's any help, the value stored in the float is just an integer value, and not a particularly big one.  I just put it in a float to avoid casting.)</p>

Printing a value to cout should not change the value of the paramter in any way at all.
However, I have seen similar behaviour, adding debugging statements causes a change in the value. In those cases, and probably this one as well my guess was that the additional statements were causing the compiler's optimizer to behave differently, so generate different code for your function.
Adding the cout statement means that the vaue of x is used directly. Without it the optimizer could remove the variable, so changing the order of the calculation and therefore changing the answer.