Because it System.currentTimeMillis()
returns the current time in milliseconds.
That way, it can return large numbers, such as 1508797287829
.
Multiplying a number such as 1508797287829
by 252149039
(= 380441786171888746331
):
...
long a = 252149039;
long seed = System.currentTimeMillis();
...
seed = ((a*seed)+c) % m;
long seed
, Long.MAX_VALUE
2^63 - 1
(= 9223372036854775807
).
, BigInteger
.
, .
seed
BigInteger
.
BigInteger seed = BigInteger.valueOf(System.currentTimeMillis());
:
seed = seed.multiply(BigInteger.valueOf(a))
.add(BigInteger.valueOf(c))
.mod(BigInteger.valueOf(m));