title: Handling extremly small numbers in C++
body: <p>Let a and b be two numbers between 0 and 1.
  How to calculate <code>pow(a,10000)/(pow(a,10000)+pow(b,10000))</code>?</p>
  
  <p>Ex:-
  This following code gives -nan as output instead of 0.5</p>
  
  <pre><code>double a = 0.5,b = 0.5; 
  cout&lt;&lt;pow(a,10000)/(pow(a,10000)+pow(b,10000)); 
  </code></pre>