Random with Range

Discuss Lemur and share techniques.
Post Reply
jeremyz
Newbie
Posts: 14
Joined: 24 Feb 2013 19:07

Random with Range

Post by jeremyz »

Hello

Is there something like this: randRange(0,6) which would return values between 0 to 6?

I know I can do 'rand()*6' but curious if that function exists.

Thanks!
JZ
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Random with Range

Post by Softcore »

No there is no such built in function...

And in case you want integers between 0 and 6 then you ll go:

decl val=round(rand()*6);
jeremyz
Newbie
Posts: 14
Joined: 24 Feb 2013 19:07

Re: Random with Range

Post by jeremyz »

Thanks for the response Softcore.

-j
Post Reply