Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Random numbers in functions
- X-seq: zsh-users 12243
- From: Justin M Wozniak <jwozniak@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Random numbers in functions
- Date: Tue, 20 Nov 2007 12:46:35 -0500 (EST)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
Hello
I'm trying to obtain random numbers from my own distribution and
I'd like to wrap all the arithmetic in ZSH functions which query $RANDOM
or rand48(). However, I keep getting the same numbers over and over
again. I can avoid this by querying $RANDOM in the parent routines but
I'd like to encapsulate everything in the subroutines.
I'm thinking of saving the result of the last $RANDOM value in a
global variable R and then seeding RANDOM=$R at each invocation. Will
this result in an equivalent quality of randomness?
Are there any other solutions?
Thanks
--
Justin Michael Joseph Wozniak
Messages sorted by:
Reverse Date,
Date,
Thread,
Author