title: Modulus not positive :BigInteger
body: <p>error ---Modulus not positive</p>
  
  <p>BigInteger is taking vaule 0, or -ve, but i can't figure out where</p>
  
  <pre><code>public int[] conCheck(BigInteger big)
  {
      int i=0,mul=1;
      int a[]= new int[10];
      int b[]= new int[10];
      BigInteger rem[]= new BigInteger[11]; 
      BigInteger num[]= new BigInteger[11]; 
  
  
      String s="100000000";//,g="9";
      //for(i=0;i&lt;5;i++)
      //s=s.concat(g);
  
      BigInteger divi[]= new BigInteger[11]; 
      divi[0]=new BigInteger(s);
      num[0]=big; 
      for(i=0;i&lt;10;i++)  
      {    
          int z = (int)Math.pow((double)10,(double)(i+1));
          BigInteger zz = new BigInteger(String.valueOf(z));
          divi[i+1]=divi[i].divide(zz);
          num[i+1]=num[i].divide(zz);
      }
  
  {   for(i=0;i&lt;10;i++) 
  
      {
          rem[i] = num[i].mod(divi[i]);       
          b[i]=rem[i].intValue();
          if(i&gt;=4)
          {
              mul= b[i]*b[i-1]*b[i-2]*b[i-3]*b[i-4]; 
          }
  
          a[i]=mul;
      }
      }
  
  
      return a;
  
  
  }
  </code></pre>
  
  <p>Error as on Console</p>
  
  <pre><code>C:\jdk1.6.0_07\bin&gt;java euler/BigConCheck1
  Exception in thread "main" java.lang.ArithmeticException: BigInteger: modulus no
  t positive
          at java.math.BigInteger.mod(BigInteger.java:1506)
          at euler.BigConCheck1.conCheck(BigConCheck1.java:31)
          at euler.BigConCheck1.main(BigConCheck1.java:65)
  </code></pre>