CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: OReubens

Search: Search took 0.17 seconds.

  1. Replies
    30
    Views
    19,434

    Re: Generating big random numbers in C

    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...
  2. Replies
    30
    Views
    19,434

    Re: Generating big random numbers in C

    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...
  3. Replies
    30
    Views
    19,434

    Re: Generating big random numbers in C

    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...
  4. Replies
    30
    Views
    19,434

    Re: Generating big random numbers in C

    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...
  5. Replies
    30
    Views
    19,434

    Re: Generating big random numbers in C

    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...
Results 1 to 5 of 5





Click Here to Expand Forum to Full Width

Featured