rnd question

Post Reply
mrRothchildsjr
Posts: 6
Joined: Wed Nov 05, 2014 6:22 pm

rnd question

Post by mrRothchildsjr »

hi, i have a code snippet..

0 d1 = int(RND(1) * 10000 + 1)

this should produce a random number between 1 and 10,000.. how would I augment the snippet to produce a number between 1,000 and 10,000 i.e. a floor..-Eliott

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: rnd question

Post by Mr. Kibernetik »

a = RND(9000)+1000

mrRothchildsjr
Posts: 6
Joined: Wed Nov 05, 2014 6:22 pm

Re: rnd question

Post by mrRothchildsjr »

thanks..do I need a + 1 to loosen the upper bound, i.e. 9999 vs 10000

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: rnd question

Post by Mr. Kibernetik »

Please refer to documentation on RND() function for details of its functionality.

Post Reply