1

i am trying to make an array of biginteger of size biginteger.

public class Polynomial4   
{  
private BigInteger[] coef;      
private BigInteger deg;   
public Polynomial4(BigInteger a,BigInteger b)   
{  
coef =  new BigInteger[b+1];// here its giving the error   
coef[b] = a; // here also its showing error *  ///required int found Biginteger  

}    

}    

please help me....thanks in advance....

1
  • 1
    It makes no sense to use a BigInteger for the size of an array. The maximum theoretical size is about Integer.MAX_VALUE (although most systems can't even create arrays that big) Commented Feb 23, 2013 at 9:17

1 Answer 1

5

BigInteger has an intValue method. which converts BigInteger into an int primitive.arrays expect an int as its size while BigInteger is an object.

    coef =  new BigInteger[b.intValue()+1];
       coef[b.intValue()] = a; 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.