Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / RND Random Number Generator

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. RND Random Number Generator
#1155
Posted by: boltex 2004-02-01 16:48:31
Hi all, I was in need of some "good" random number generation and i made some reading in rapid-q's doc, it says that rnd returns a "SHORT" type number but a decimal one if no upperbounds provided... so decimal is not a short integer,, Who is right? does anyone here have any experience with Random number generation with rapidQ or in general?

What is a good seed? does it make a difference?

Anyone know of a reliable random number generator i could use in rapidQ? like in the form of a DLL for example? i sak because i made tests generating random numbers between 0-10000 and it seems a lot get hit multiple times while others tend to be less lucky, as if the RND generator did not "spread" it's return values in all the range it should be doing.

anyways, any thoughts on the matter would be appreciated. !
--
bolt
Message2. Re: RND Random Number Generator
#1156
Posted by: 2004-02-01 22:03:46
use the system clock (the variable TIMER) as a seed. If you do not use a seed the RND function will always use the same sequence of numbers.

Also .... a random number generator will normally even out over time, it is not unusual to get a load of "hits" on a few numbers for quite a while.

Amazingly good random number generation is a very big computer problem actually, as computers are designed to be as un-random as possible.
Message3. Re: RND Random Number Generator
#1157
Posted by: boltex 2004-02-02 10:49:06
Thank you for your help but for most programmers, it IS a good thing to be able to repeat a list of RND numbers and using the seed as a way to "record" all RND generated, say during a game for game-replay reasons like in Warcraft3, or starcraft,...

I have some experience with RND number gens, but i was asking if someone had any Exp with RapidQ RND in particular. ?

Sincere Thanks to all RapidQers
--
b
Message4. Re: RND Random Number Generator
#1160
Posted by: boltex 2004-02-05 06:16:12
A good fellow on yahoo's e group gave an algo, im gonna test it and share results over here...

--
b
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-4-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0