Question about RND function

In this category you can exchange your programming questions and solutions.
Post Reply
GSAC3
Posts: 20
Joined: Wed Jun 27, 2007 8:15 pm

Question about RND function

Post: # 1020Post GSAC3
Thu Jan 17, 2013 7:08 pm

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

Giovanni Di Maria
Posts: 8
Joined: Tue Feb 01, 2011 8:57 pm

Question about RND function

Post: # 1021Post Giovanni Di Maria
Thu Feb 07, 2013 8:48 am

Try with:
random= (rnd(n) + timer) mod n
Giovanni Di Maria
www.elektrosoft.it


Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Question about RND function

Post: # 1022Post Marco
Thu Feb 07, 2013 4:43 pm

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

GSAC3
Posts: 20
Joined: Wed Jun 27, 2007 8:15 pm

Question about RND function

Post: # 1023Post GSAC3
Fri Feb 08, 2013 12:22 am

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


Bob Hays
Posts: 26
Joined: Sun Oct 03, 2010 4:49 pm

Question about RND function

Post: # 1024Post Bob Hays
Mon Feb 11, 2013 12:00 am

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.

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Question about RND function

Post: # 1025Post Marco
Fri Feb 15, 2013 4:27 pm

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

GSAC3
Posts: 20
Joined: Wed Jun 27, 2007 8:15 pm

Question about RND function

Post: # 1026Post GSAC3
Sun Feb 17, 2013 9:05 pm

Thanks Marco!

Don

GSAC3
Posts: 20
Joined: Wed Jun 27, 2007 8:15 pm

Question about RND function

Post: # 1027Post GSAC3
Tue Oct 15, 2013 4:16 am

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

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Question about RND function

Post: # 1028Post Marco
Tue Oct 15, 2013 3:35 pm

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

GSAC3
Posts: 20
Joined: Wed Jun 27, 2007 8:15 pm

Question about RND function

Post: # 1029Post GSAC3
Tue Oct 15, 2013 6:54 pm

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

Post Reply