Page 1 of 1

rnd question

Posted: Fri Apr 17, 2015 11:40 am
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

Re: rnd question

Posted: Fri Apr 17, 2015 11:55 am
by Mr. Kibernetik
a = RND(9000)+1000

Re: rnd question

Posted: Fri Apr 17, 2015 12:22 pm
by mrRothchildsjr
thanks..do I need a + 1 to loosen the upper bound, i.e. 9999 vs 10000

Re: rnd question

Posted: Fri Apr 17, 2015 1:12 pm
by Mr. Kibernetik
Please refer to documentation on RND() function for details of its functionality.