Question about RND function
Question about RND function
Marco:
Can the seed used by the random number generator (RND) be set? If so, how can it be done? Is there something like a "RANDOMIZE(x)" function?
I am trying to create repeatable lists of random numbers.
Don
Can the seed used by the random number generator (RND) be set? If so, how can it be done? Is there something like a "RANDOMIZE(x)" function?
I am trying to create repeatable lists of random numbers.
Don
-
- Posts: 8
- Joined: Tue Feb 01, 2011 8:57 pm
Question about RND function
Try with:
random= (rnd(n) + timer) mod n
Giovanni Di Maria
www.elektrosoft.it
random= (rnd(n) + timer) mod n
Giovanni Di Maria
www.elektrosoft.it
Question about RND function
Hi, i just see this.
the seed of rnd is always 1 the max number can be set ; rnd(0-max)
after that you must do a little calculation.
supose you want have a seed of .5 to the max of 20.
the syntax must be random=rnd(40)*.5 then you get a seed of .5 between 0 and 20 (=.5*40)
if you want those number between 100 and 120 just add 100;
random=rnd(40)*.5+100
I hope this will help you
best regards
the seed of rnd is always 1 the max number can be set ; rnd(0-max)
after that you must do a little calculation.
supose you want have a seed of .5 to the max of 20.
the syntax must be random=rnd(40)*.5 then you get a seed of .5 between 0 and 20 (=.5*40)
if you want those number between 100 and 120 just add 100;
random=rnd(40)*.5+100
I hope this will help you
best regards
Question about RND function
Marco:
Thanks for your reply, but maybe I did not make myself clear.
What I would like to be able to do is set the INITIAL SEED each time I use the random number generator, as most other random number generators allow, in order to assure that the random number sequence produced is the same each time the generator is initialized with the same seed before it is used.
Right now, it appears that the INITIAL SEED that RND uses is itself random.
Is there some way to set the INITIAL SEED before RND is used to produce a sequence of random numbers?
Don
Thanks for your reply, but maybe I did not make myself clear.
What I would like to be able to do is set the INITIAL SEED each time I use the random number generator, as most other random number generators allow, in order to assure that the random number sequence produced is the same each time the generator is initialized with the same seed before it is used.
Right now, it appears that the INITIAL SEED that RND uses is itself random.
Is there some way to set the INITIAL SEED before RND is used to produce a sequence of random numbers?
Don
Question about RND function
Admin
Could you add a Randomize function that would give us this capability? :question
Sometimes it is adventagious to have pre-determined random numbers for testing.
Could you add a Randomize function that would give us this capability? :question
Sometimes it is adventagious to have pre-determined random numbers for testing.
Question about RND function
yes, it alright with me. although its not really random any more. I will build in a vb like function and leave the old rnd in.
best regards
best regards
Question about RND function
Marco:
Have you had a chance to build in a new vb like function to generate random numbers using a user-specified initial seed yet?
Don
Have you had a chance to build in a new vb like function to generate random numbers using a user-specified initial seed yet?
Don
Question about RND function
yes, i had to look in my readme. It comes with the next update.
And the next update comes soon.
So please wait a little, i had to check fnx before the update.
best regards marco
And the next update comes soon.
So please wait a little, i had to check fnx before the update.
best regards marco
Question about RND function
Marco:
Thanks very much for the update.
I know you must be busy with FNX update work, and I really appreciate your response to my query.
Don
Thanks very much for the update.
I know you must be busy with FNX update work, and I really appreciate your response to my query.
Don