title: how java.bigInteger valueOf works?
body: <p>I'm making a project concerned big numbers without BigInteger, BigDecimal etc. I've managed to do all the basics but now I need to add ability to count factorials. My BigNumber stores data as int[] .</p>
  
  <p>Here's a sample solution with BigInteger but I can't use it without having the actual value of my number.</p>
  
  <pre><code>    BigInteger n = BigInteger.ONE;
      for (int i=1; i&lt;=20; i++) {
          n = n.multiply(BigInteger.valueOf(i));
          System.out.println(i + "! = " + n);
      }
  </code></pre>
  
  <p>So how to count the value ? Add ints from last to first, multiplying tens by 10, hundreds by 100 and so on and so on and store it as long ?</p>
  
  <p>Source of BigInteger :
  <a href="http://developer.classpath.org/doc/java/math/BigInteger-source.html" rel="nofollow noreferrer">http://developer.classpath.org/doc/java/math/BigInteger-source.html</a></p>