Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Random numbers in functions



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