Creating random unique BigIntegers in a given range?

I'm new to using BigInteger, so I try to read the documentation best. I'm still confused. I need to create 500 random numbers between a range of 2 ^ 70 and 2 ^ 80, and I don't know how to set the range for BigIntegers.

I get possible duplicate messages, so probably I should add that I already examined the solutions in this and still don’t understand how to solve my problem: How to create a random BigInteger value in Java?

+4
source share
1 answer

There is a built-in method for generating a random BigInteger between 0 and 2 ^ n - 1.

2 ^ 80.

2 ^ 70 (~ 0,1%). ( 500 ), .

2 ^ 70 2 ^ 80.

. , , .

+1

Source: https://habr.com/ru/post/1659243/


All Articles