title: java.lang.NumberFormatException on BigDecimal
body: <p>I want to calculate some stuff with Poisson.
  The Problem is, it works just to a value from 183...</p>
  
  <p>my Code:</p>
  
  <pre><code>import java.math.BigDecimal;
  import java.math.BigInteger;
  import java.math.RoundingMode;
  
  
  public class CopyOfPoisson {
  
      public static void main(String[] args) {
  
          double anrufe = 360;
          double minuten = 30;
          double dauer = 240;
  
          double agenten = 0; //m
  
  
          for(int i = 49; i&lt;=500; i++)
          {
              agenten = i;
              double callsPerSecond = anrufe/(minuten*60);
  
              //u
              double trafficIntensitiy = callsPerSecond*dauer;
              //p
              double p = trafficIntensitiy / agenten;
              System.out.println("Index: "+ i + " "+ erlangC(agenten,trafficIntensitiy, p));
          }
  
  
  
  
      }
  
      public static BigDecimal erlangC (double m, double u, double p)
      {
          BigDecimal zaehler = berechnePoisson(m, u, false);
          BigDecimal nenner = berechnePoisson(m, u, false).add((BigDecimal.ONE.subtract(new BigDecimal(p))).multiply( berechnePoisson(m, u, true)));
          return zaehler.divide(nenner,100,RoundingMode.HALF_EVEN);
      }
  
      public static BigDecimal berechnePoisson(double m, double u, boolean va)
      {
  
          BigDecimal answer = BigDecimal.ZERO;
          if(!va)
          {
              BigDecimal myOwn = new BigDecimal(Double.toString(Math.exp(-u)* Math.pow(u, m)));
              answer = myOwn.divide(fakultaet2(m),100,RoundingMode.HALF_EVEN);
          }
          if(va)
          {
              for(int i = 0; i &lt; m; i++)
              {
                  BigDecimal myOwn2 = new BigDecimal(Double.toString(Math.exp(-u)*Math.pow(u, i)));
                  answer = answer.add(myOwn2.divide(fakultaet2(i),100,RoundingMode.HALF_EVEN));
              }
          }
  
          return answer;
      }
  
  
      public static BigDecimal fakultaet2 (double n)
      {
          BigDecimal fct = BigDecimal.valueOf(1);
          for(int i = 1; i&lt;=n; i++)
          {
              fct = fct.multiply(BigDecimal.valueOf(i));
          }
  
          return fct;
      }
  
  }
  </code></pre>
  
  <p>After the loop reaches 184 it gives me an Error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NumberFormatException
  at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:494)
  at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:383)
  at java.math.BigDecimal.&lt;init&gt;(BigDecimal.java:806)
  at CopyOfPoisson.berechnePoisson(CopyOfPoisson.java:47)
  at CopyOfPoisson.erlangC(CopyOfPoisson.java:36)
  at CopyOfPoisson.main(CopyOfPoisson.java:26)
  </code></pre>
  
  <p>on the Line</p>
  
  <pre><code>BigDecimal myOwn = new BigDecimal(Double.toString(Math.exp(-u)* Math.pow(u, m)));
  </code></pre>
  
  <p>What is the problem? I want to calculate till <code>i &lt;= 500</code>, but only calculates to <code>i = 183</code>.</p>