title: Getting NaN / Infinity Error when converting Double to BigDecimal
body: <p>So I have this division between <code>double</code>s (from values it gets in a database);</p>
  
  <pre><code> indPayRatio[loadCounter] = c.getDouble(c.getColumnIndex("payment")) / c.getDouble(c.getColumnIndex("debt_total"));
  </code></pre>
  
  <p>There is no case where either of the values can be blank.  They HAVE to be something here.</p>
  
  <p>Well I get this crazy long number sometimes, so I convert it to <code>BigDecimal</code> like so:</p>
  
  <pre><code> bdRatio = new BigDecimal(indPayRatio[i]);
  </code></pre>
  
  <p>At this line, I get the following stack trace from many users.  I am unable to replicate it so I am unsure of the value.</p>
  
  <pre><code>java.lang.RuntimeException: An error occured while executing doInBackground()
  at android.os.AsyncTask$3.done(AsyncTask.java:300)
  at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
  at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
  at java.util.concurrent.FutureTask.run(FutureTask.java:242)
  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
  at java.lang.Thread.run(Thread.java:841)
  Caused by: java.lang.NumberFormatException: Infinity or NaN: NaN
  at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:465)
  at com.---.---.DebtDataSource.payoffDebt(DebtDataSource.java:544)
  at com.---.---.PlannerFragment$PlannerTask.doInBackground(PlannerFragment.java:177)
  at com.---.---.PlannerFragment$PlannerTask.doInBackground(PlannerFragment.java:143)
  at android.os.AsyncTask$2.call(AsyncTask.java:288)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  ... 4 more
  </code></pre>
  
  <p>My first hunch, is that I should be using <code>BigDecimal</code> to multiply at the first line, but if that is the issue, why am I getting the error when I convert it to <code>BigDecimal</code>?</p>