title: c# - outputting a value of infinity
body: <p>I have part of the calculation that is modified to explain what issue I'm having. I'm converting a working Java code into a c# application.</p>
  
  <p>A double variable is declared doing the following calculation and the following input values being passed along for example:</p>
  
  <pre><code>double input1 = 45
  double input2 = 42
  double input3 = 1
  
  double a = (input1 - input2 * Math.Pow(input3, 2.0)) / (1 - Math.Pow(input3, 2.0));
  </code></pre>
  
  <p>This outputs as an Infinite in c# but Java shows the value. With infinite being outputted, the other calculations below are affected.</p>
  
  <pre><code>double b = input1 + input2 - 2 * a (becomes -Infinite)
  double c = b + a (gives you NaN)
  </code></pre>
  
  <p>a,b, and c are outputted into individual text boxes and each either show as Infinite or NaN.</p>
  
  <pre><code>Textbox1.Text = a.ToString("F") (Infinite)
  Textbox2.Text = b.ToString("F") (-Infinite)
  Textbox3.Text = c.ToString("F") (NaN)
  </code></pre>
  
  <p>I know that this is due to IEEE standards, but is there actually a way that variable <strong><em>a</em></strong> shows the value instead of showing infinite so that it doesn't affect the calculations or output the results into a text box in 2 decimal places?</p>