help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] How random is $RANDOM?


From: Peng Yu
Subject: [Help-bash] How random is $RANDOM?
Date: Thu, 9 May 2019 06:33:07 -0500

Let's say two bash processes call $RANDOM at the exact same time. Will
the results be the same? Or the results will be different.

Also, is the low bits of $RANDOM more random or the high bits of
$RANDOM more random. I see examples using $RANDOM%n to map the random
number to a smaller range. But my understanding in other random
numbers is that the high bits are more random and using the modulus is
discouraged. I am not sure what is the recommended usage of $RANDOM to
map it to a smaller range. Does anybody know the best use of $RANDOM
in this case? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]