Error assigning to an an element in an array of BigInteger

前端 未结 4 547
小蘑菇
小蘑菇 2021-01-24 21:42

This is my code. It shows an error when I create an array of BigInteger and try to assign a value.

package test;
import java.math.*;
import java.la         


        
4条回答
  •  春和景丽
    2021-01-24 22:07

    KEEP IN MIND ALWAYS

    All numbers greater then 2147483647 will not be allowed as input because int range is -2147483648 to 2147483647 (Never forget it). If just in case your output is greater than the limit it will reverse and to its lowest value i.e -2147483648.

    I recommend that you use:

    coef[a]=new BigInteger("324576565343453456546456546546456456456455643671"); 
    

    All important functions are in java.lang.Math class and you can perform arithmetic operations by passing a string to it.

提交回复
热议问题