Hi,

Bash uses the low 16 bits for $RANDOM.

https://git.savannah.gnu.org/cgit/bash.git/tree/variables.c#n1321
https://git.savannah.gnu.org/cgit/bash.git/tree/variables.c#n1356

It seems that the high bits should be more random. If so, maybe the
high 16 bits should be kept if $RANDOM must stay in 16bits?

https://stackoverflow.com/questions/13104478/uniformity-of-random-numbers-taken-modulo-n

-- 
Regards,
Peng

Reply via email to