Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Random numbers in functions
- X-seq: zsh-users 12246
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Random numbers in functions
- Date: Tue, 20 Nov 2007 19:49:03 +0000
- In-reply-to: <Pine.GSO.4.61.0711201411140.5718@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200711201823.lAKIN5oM011816@xxxxxxxxxxxxxx> <Pine.GSO.4.61.0711201411140.5718@xxxxxxxxxx>
On Tue, 20 Nov 2007 14:30:39 -0500 (EST)
Justin M Wozniak <jwozniak@xxxxxxxxxx> wrote:
> Thanks! But since I'm planning to obtain many random numbers I'd like to
> do this without file operations. Using a global variable should be
> equivalent to your solution but the output of rand48() seems to be
> convergent.
I thought your problem was that you were running stuff in different
shells or subshells or something. However, as you're not, it seems
likely you're running across a bug:
2004-06-08 Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
* 20029: Src/Modules/mathfunc.c: rand48(seed) stopped being
random after the second call.
That was fixed a while ago, however; it should even be in the current 4.2.x
version.
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author