Reputation: 279
I've looked a lot through here and can't quite find why this line is wrong:
ArrayList <BigInteger> data = new ArrayList();
int [] primes = new int[25];
...
// Some initializing
...
data.get(i) = data.get(i).divide( BigInteger.valueOf( primes[place] ) ); //<----
...
// Rest of the code
Required: variable; Found: value.. What I'm doing wrong?
Upvotes: 3
Views: 69
Reputation: 201447
First, you should fix your Raw Type (and I'd prefer the List
interface) like
List<BigInteger> data = new ArrayList<>();
then you need to use set
because you can't assign to the return value of a get
like that.
data.set(i, data.get(i).divide(BigInteger.valueOf(primes[place])));
Also, it's worth noting that BigInteger
(s) are (per the Javadoc) immutable arbitrary-precision integers.
Upvotes: 6
Reputation: 58868
=
only works to assign variables, fields and array elements.
You probably want to call set
.
data.set(i, data.get(i).divide(...etc...));
Upvotes: 5