On 2009-06-06 17:11Z, Tuomo Latto wrote:

> David Lucena wrote:

>>> I need to generate a large number of random numbers. The

>>> normal rand function that mingw supports generates numbers

>>> only till 32767- ie it can give me at most 32767 random

>>> numbers. I'll need random numbers in the range of say 5

>>> million. I have not been able to find any built in function

>>> that does this on msdn etc. I've read on forums that

>>> this is compiler dependent and can't be changed. I can

>>> of course write my own routine to generate random numbers,

>>> but before I do this I'd like to know if there is

>>> another existing way of generating random numbers that would

>>> fit my requirements. Any pointers would be helpful.

>>

>> A simple idea could be generating two or three random numbers and multiply them.

>

> I think that would seriously warp the distribution.

For one extreme example of warpage, consider the distribution of

the product of three random boolean values--or the product of

a thousand of them.

> Which, I suppose, brings us to quality issues, etc.

http://en.wikipedia.org/wiki/Pseudorandom_number_generator| Careful mathematical analysis is required to have any confidence a PRNG

| generates numbers that are sufficiently "random" to suit the intended use.

| [An expert] once titled an article, "The generation of random numbers is

| too important to be left to chance."

Fortunately, there's plenty of well-tested free code available.

------------------------------------------------------------------------------

OpenSolaris 2009.06 is a cutting edge operating system for enterprises

looking to deploy the next generation of Solaris that includes the latest

innovations from Sun and the OpenSource community. Download a copy and

enjoy capabilities such as Networking, Storage and Virtualization.

Go to:

http://p.sf.net/sfu/opensolaris-get_______________________________________________

MinGW-users mailing list

[hidden email]
This list observes the Etiquette found at

http://www.mingw.org/Mailing_Lists.

We ask that you be polite and do the same.

Most annoying abuses are:

1) Top posting

2) Thread hijacking

3) HTML/MIME encoded mail

4) Improper quoting

5) Improper trimming

_______________________________________________

You may change your MinGW Account Options or unsubscribe at:

https://lists.sourceforge.net/lists/listinfo/mingw-users