我正在尝试制作一个大整数的大整数数组。
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
}
}
请帮助我......提前致谢....
答案 0 :(得分:5)
BigInteger 有intValue方法。它将BigInteger转换为int原语.arrays期望int为其大小,而BigInteger为对象。
coef = new BigInteger[b.intValue()+1];
coef[b.intValue()] = a;