March 4th, 2013, 09:46 AM
It's one method of reducing a UD...
This preserves the uniform distribution. It doesn't preserve all the random behaviour. And it definately doesn't preserve periodicity (it throws away some of...
March 1st, 2013, 08:53 AM
No, i'm saying that putting it in a double does not make it 'more uniform' than the integer.
rand() returns RAND_MAX unique integers. The returned integers are 'assumed' to be a uniform...
February 26th, 2013, 09:09 AM
Well I wasn't referring to rand() specifically which is indeed not guaranteed to be a power of 2 minus 1 (although i've never seen a different one in any of the many compilers I used). Which is...
February 25th, 2013, 06:03 AM
it doesn't. it has an under-bias for 0. Because of the +0.5 correction, 0 will appear about half as much as any other number.
there is also an under-bias for 255, because you shifted that half of...
February 20th, 2013, 08:08 AM
the problem with using rand() (or any other PRNG function) to generate bigger random numbers than it can really handle out of it's own.
- You will probably reduce the periodicity of the PRNG. So...