Trouble evaluating a formula in C++
<p>I am having trouble getting this program to evaluate a range of values through a formula. </p>

<blockquote>
  <p>range = (-3.0,4.0) formula = (9(x^3)-27(x^2)-4x+12) / (sqrt(3(x^2)+1)
  + abs(5-(x^4)))</p>
</blockquote>

<p>The program prints out the <code>y as -1.IND</code></p>

<p>Any help on shedding light on why all the y comes out as <code>-1.IND</code> is appreciated.</p>

<p>Thanks, Dave </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cmath&gt;
using namespace std;

int main() {
    cout &lt;&lt; "This program outputs formula results\n";
    long double x = -3.0;
    long double y = 1.0;
    long double a = (9*(pow(x,3))-27*(pow(x,2))-4*x+12);
    long double b = (sqrt(3*(pow(x,2))+1) + abs(5-(pow(x,4))));
    y = a/b;

        for(;x &lt;4.5; x=x+.5){
            cout &lt;&lt; "X = " &lt;&lt; x &lt;&lt; ", " &lt;&lt; "Y = " &lt;&lt; y;
        if(y==0)
            cout &lt;&lt; "Y IS ZERO" &lt;&lt; endl;
        else if(y&lt;0)
            cout &lt;&lt; "Y IS NEGATIVE" &lt;&lt; endl;
        else if(y&gt;0)
            cout &lt;&lt; "Y IS POSITIVE\n" &lt;&lt; endl;
        }
    return 0;
}
</code></pre>
