I want to make random array of int64
uniformly distributed in some range that is not within int32
limits.
There is randint
and random_integers
but they work with int32
; supplying big upper limit produces high is out of bounds for int32
.
How do I generate random int64
array with specified range?
Possible solutions:
- Use floats generator. Won't it have poor resolution in this case?
- Generate random bytes, interpret them as
int64
array and then normalize vialower + x % (upper - lower)
. But doint32
generation has same normalization? Doesn't it affect uniformity?
Didn't I miss some more concise and convenient ways?
Aucun commentaire:
Enregistrer un commentaire