Thread: Seeded/Seedless random number

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,560
    That may mean that you could use this for normal simulations, but secure applications is a different story though: the issue of entropy remains. It is akin to the issue of having state that can be determined without exhausting the pseudorandom sequence for a PRNG, which is why even PRNGs that pass statistical tests with flying colours do not necessarily qualify as cryptographically secure PRNGs, although they certainly could see other uses.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Quote Originally Posted by laserlight View Post
    That may mean that you could use this for normal simulations, but secure applications is a different story though: the issue of entropy remains. It is akin to the issue of having state that can be determined without exhausting the pseudorandom sequence for a PRNG, which is why even PRNGs that pass statistical tests with flying colours do not necessarily qualify as cryptographically secure PRNGs, although they certainly could see other uses.
    It can still be used in security software but for the simple reason of security it shouldn't ne used on its own so for example one could include multple RNGs and add their results together making it much harder to predict the final number used, to be honest I don't think even the online ones should be used on their own, its better to mix everything and increase the security of the final result

  3. #18
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    713
    Quote Originally Posted by awsdert View Post
    the command I gave was
    Code:
    dieharder -a < ./mcc_rnd_die.elf
    Is that command doing what you think it does? That command redirects the executable file itself to the standard input of the "dieharder" program. It doesn't execute ./mcc_rnd_die.elf.

  4. #19
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    If you know better then please, I'm all eyes

  5. #20
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,560
    christop is right though. My guess is that's supposed to be:
    Code:
    ./mcc_rnd_die.elf | dieharder -a
    But I haven't read the relevant documentation so I could be wrong.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #21
    Registered User
    Join Date
    May 2009
    Posts
    3,775
    Quote Originally Posted by laserlight View Post
    christop is right though. My guess is that's supposed to be:
    Code:
    ./mcc_rnd_die.elf | dieharder -a
    But I haven't read the relevant documentation so I could be wrong.
    From dieharder(1) - Linux man page
    Code:
    cat /dev/urandom | ./dieharder -a -g 200
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  7. #22
    Registered User
    Join Date
    Feb 2019
    Posts
    647
    A simple test for the code at post #7... Take a look at:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
     
    // Scale 'n' to 24 bits (0xBBGGRR).
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0 ) / RAND_MAX ) )
     
    int main ( void )
    {
      int x, y, r;
     
      srand( time(NULL) );
     
      fputs( "P6\n1024 1024\n255\n", stdout );
     
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ ) 
        { 
          r = rand2rgb(rand());
          fwrite( &r, 3, 1, stdout );  // assume little endian. 
        }
    }
    This will create a graphic file where each pixel is scaled to 24 bits and used as RGB value in a 1024x1024 surface. It will result in a "noisy" surface like this:
    Seeded/Seedless random number-rand1_1-png
    Now, take a look at your routine in #7, mildly modified (my comments):
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <limits.h>
     
    // Scale n to 24 bit value (0xBBGGRR).
    // OBS: Uses long double because 'long' is 64 bits long in x86-64 systems.
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0L ) / LONG_MAX ) )
     
    // using size_t instead of ptrdiff_t (same thing)
    typedef size_t mcc_rnd_t;
     
    static long mcc_rnd ( mcc_rnd_t *seed, long min, long max );
     
    int main ( void )
    {
      int x, y;
      int r;
      long seed = 1;
     
      fputs ( "P3 1024 1024 255\n", stdout );
     
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ ) 
        { 
          r = rand2rgb ( mcc_rnd ( &seed, 0, LONG_MAX ) ); 
          fwrite ( &r, 3, 1, stdout );
        }
    }
     
    long mcc_rnd ( mcc_rnd_t *seed, long min, long max )
    {
      // Most of the time tmp will point to the SAME memory block
      // for every process. Notice that, probably, tmp is aligned,
      // meaning the lower bits aren't 'random' at all... 
      // and the upper bits isn't random as well...
      void *tmp = malloc ( 1 );
     
      long val = time ( NULL ) + ( size_t ) tmp;
     
      free ( tmp );
     
      // This isn't 'random' seed. Taking the argument address means 
      // it will be copied to the stack and the stack pointer isn't
      // that 'random'... The value on stack isn't that unpredictable
      // as you think!
      if ( ! seed )
        seed = ( mcc_rnd_t * ) ( &seed );
     
      // Well... this isn't random, again, isn't it?
      if ( ! *seed )
        *seed = 1;
     
      val %= *seed;
      val *= clock();
     
      // The seed, again, isn't random!
      *seed <<= 1; 
     
      // Saturation get even less random values! 
      return ( val > max ) ? max : ( val < min ? min : val );
    }
    This will create a graphic like this:
    Seeded/Seedless random number-rand2_1-png
    See the patterns? Not random at all!

  8. #23
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Quote Originally Posted by flp1969 View Post
    A simple test for the code at post #7... Take a look at:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
     
    // Scale 'n' to 24 bits (0xBBGGRR).
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0 ) / RAND_MAX ) )
     
    int main ( void )
    {
      int x, y, r;
     
      srand( time(NULL) );
     
      fputs( "P6\n1024 1024\n255\n", stdout );
     
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ ) 
        { 
          r = rand2rgb(rand());
          fwrite( &r, 3, 1, stdout );  // assume little endian. 
        }
    }
    This will create a graphic file where each pixel is scaled to 24 bits and used as RGB value in a 1024x1024 surface. It will result in a "noisy" surface like this:
    Seeded/Seedless random number-rand1_1-png
    Now, take a look at your routine in #7, mildly modified (my comments):
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <limits.h>
     
    // Scale n to 24 bit value (0xBBGGRR).
    // OBS: Uses long double because 'long' is 64 bits long in x86-64 systems.
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0L ) / LONG_MAX ) )
     
    // using size_t instead of ptrdiff_t (same thing)
    typedef size_t mcc_rnd_t;
     
    static long mcc_rnd ( mcc_rnd_t *seed, long min, long max );
     
    int main ( void )
    {
      int x, y;
      int r;
      long seed = 1;
     
      fputs ( "P3 1024 1024 255\n", stdout );
     
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ ) 
        { 
          r = rand2rgb ( mcc_rnd ( &seed, 0, LONG_MAX ) ); 
          fwrite ( &r, 3, 1, stdout );
        }
    }
     
    long mcc_rnd ( mcc_rnd_t *seed, long min, long max )
    {
      // Most of the time tmp will point to the SAME memory block
      // for every process. Notice that, probably, tmp is aligned,
      // meaning the lower bits aren't 'random' at all... 
      // and the upper bits isn't random as well...
      void *tmp = malloc ( 1 );
     
      long val = time ( NULL ) + ( size_t ) tmp;
     
      free ( tmp );
     
      // This isn't 'random' seed. Taking the argument address means 
      // it will be copied to the stack and the stack pointer isn't
      // that 'random'... The value on stack isn't that unpredictable
      // as you think!
      if ( ! seed )
        seed = ( mcc_rnd_t * ) ( &seed );
     
      // Well... this isn't random, again, isn't it?
      if ( ! *seed )
        *seed = 1;
     
      val %= *seed;
      val *= clock();
     
      // The seed, again, isn't random!
      *seed <<= 1; 
     
      // Saturation get even less random values! 
      return ( val > max ) ? max : ( val < min ? min : val );
    }
    This will create a graphic like this:
    Seeded/Seedless random number-rand2_1-png
    See the patterns? Not random at all!
    Have you tried the updated code instead of old code?

  9. #24
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Quote Originally Posted by stahta01 View Post
    From dieharder(1) - Linux man page
    Code:
    cat /dev/urandom | ./dieharder -a -g 200
    Tim S.
    Been reading the docs and seems to be fine with stdin but to satisfy your curiosity I'll try it when I get home

  10. #25
    Registered User
    Join Date
    Feb 2019
    Posts
    647
    Quote Originally Posted by awsdert View Post
    Have you tried the updated code instead of old code?
    This one?

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <limits.h>
    
    // Scale n to 24 bit value (0xBBGGRR).
    // OBS: Uses long double because 'long' is 64 bits long in x86-64 systems.
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0L ) / ULONG_MAX ) )
    
    // using size_t instead of ptrdiff_t (same thing)
    typedef size_t mcc_rnd_t;
    
    static unsigned long mcc__rnd( mcc_rnd_t *seed );
    
    int main( void )
    {
      int x, y;
      int r;
      long seed = 1;
    
      fputs( "P6\n1024 1024\n255\n", stdout );
    
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ )
        {
          r = rand2rgb( mcc__rnd( &seed ) );
          fwrite( &r, 3, 1, stdout );
        }
    }
    
    unsigned long mcc__rnd( mcc_rnd_t *seed )
    {
      /* Initial random value */
      unsigned long val = ( unsigned long )( &seed ) * ( unsigned long )clock() * ( unsigned long )clock();
    
      if ( seed )
      {
        if ( *seed == 0 )
          *seed = 1;
    
        val %= *seed;
        *seed <<= 1;
      }
    
      return val;
    }
    it is worse:

    Seeded/Seedless random number-pic-png

  11. #26
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Quote Originally Posted by flp1969 View Post
    This one?

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    #include <limits.h>
    
    // Scale n to 24 bit value (0xBBGGRR).
    // OBS: Uses long double because 'long' is 64 bits long in x86-64 systems.
    #define rand2rgb(n) \
      ( ( int ) ( ( (n) * 16777215.0L ) / ULONG_MAX ) )
    
    // using size_t instead of ptrdiff_t (same thing)
    typedef size_t mcc_rnd_t;
    
    static unsigned long mcc__rnd( mcc_rnd_t *seed );
    
    int main( void )
    {
      int x, y;
      int r;
      long seed = 1;
    
      fputs( "P6\n1024 1024\n255\n", stdout );
    
      for ( y = 0; y < 1024; y++ )
        for ( x = 0; x < 1024; x++ )
        {
          r = rand2rgb( mcc__rnd( &seed ) );
          fwrite( &r, 3, 1, stdout );
        }
    }
    
    unsigned long mcc__rnd( mcc_rnd_t *seed )
    {
      /* Initial random value */
      unsigned long val = ( unsigned long )( &seed ) * ( unsigned long )clock() * ( unsigned long )clock();
    
      if ( seed )
      {
        if ( *seed == 0 )
          *seed = 1;
    
        val %= *seed;
        *seed <<= 1;
      }
    
      return val;
    }
    it is worse:

    Seeded/Seedless random number-pic-png
    Try without the seed set, ie NULL, also how did you get your terminal to do that? I've tried but it doesn't do that

  12. #27
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Well currently re-running dieharderwith this so far:
    Code:
    make --no-print-directory dieharder_rnd
    gcc -ggdb -Wall -lpthread -DBUILD_FOR_DIEHARDER -o ./mcc_rnd_die.elf mcc_rnd.c
    ./mcc_rnd_die.elf > diehard.txt
    dieharder -a -f diehard.txt -t 100 -Y 1
    #=============================================================================#
    #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
    #=============================================================================#
       rng_name    |           filename             |rands/second|
            mt19937|                     diehard.txt|  8.32e+07  |
    #=============================================================================#
            test_name   |ntup| tsamples |psamples|  p-value |Assessment
    #=============================================================================#
       diehard_birthdays|   0|       100|     100|0.85295815|  PASSED
          diehard_operm5|   0|   1000000|     100|0.95085512|  PASSED
      diehard_rank_32x32|   0|     40000|     100|0.84994506|  PASSED
        diehard_rank_6x8|   0|    100000|     100|0.88766341|  PASSED
       diehard_bitstream|   0|   2097152|     100|0.56787971|  PASSED
            diehard_opso|   0|   2097152|     100|0.30634647|  PASSED
            diehard_oqso|   0|   2097152|     100|0.97180228|  PASSED
             diehard_dna|   0|   2097152|     100|0.24078918|  PASSED
    diehard_count_1s_str|   0|    256000|     100|0.30519436|  PASSED
    diehard_count_1s_byt|   0|    256000|     100|0.51351868|  PASSED
     diehard_parking_lot|   0|     12000|     100|0.89432206|  PASSED
        diehard_2dsphere|   2|      8000|     100|0.99812802|   WEAK
        diehard_2dsphere|   2|      8000|     200|0.96469714|  PASSED
        diehard_3dsphere|   3|      4000|     100|0.96650039|  PASSED
         diehard_squeeze|   0|    100000|     100|0.77568347|  PASSED
            diehard_sums|   0|       100|     100|0.00051839|   WEAK
            diehard_sums|   0|       100|     200|0.00400734|   WEAK
            diehard_sums|   0|       100|     300|0.00090761|   WEAK
            diehard_sums|   0|       100|     400|0.00006661|   WEAK
            diehard_sums|   0|       100|     500|0.00002646|   WEAK
            diehard_sums|   0|       100|     600|0.00000203|   WEAK
            diehard_sums|   0|       100|     700|0.00000045|  FAILED
            diehard_runs|   0|    100000|     100|0.99080465|  PASSED
            diehard_runs|   0|    100000|     100|0.86282952|  PASSED
           diehard_craps|   0|    200000|     100|0.80909198|  PASSED
           diehard_craps|   0|    200000|     100|0.25693590|  PASSED
     marsaglia_tsang_gcd|   0|  10000000|     100|0.18319920|  PASSED
     marsaglia_tsang_gcd|   0|  10000000|     100|0.77544038|  PASSED
             sts_monobit|   1|    100000|     100|0.27733181|  PASSED
                sts_runs|   2|    100000|     100|0.81845021|  PASSED
              sts_serial|   1|    100000|     100|0.46403118|  PASSED
              sts_serial|   2|    100000|     100|0.11862501|  PASSED
              sts_serial|   3|    100000|     100|0.42804125|  PASSED
              sts_serial|   3|    100000|     100|0.96526517|  PASSED
              sts_serial|   4|    100000|     100|0.32388866|  PASSED
              sts_serial|   4|    100000|     100|0.14881751|  PASSED
              sts_serial|   5|    100000|     100|0.69732895|  PASSED
              sts_serial|   5|    100000|     100|0.74439824|  PASSED
              sts_serial|   6|    100000|     100|0.44819093|  PASSED
              sts_serial|   6|    100000|     100|0.27052991|  PASSED
              sts_serial|   7|    100000|     100|0.68303103|  PASSED
              sts_serial|   7|    100000|     100|0.98073079|  PASSED
              sts_serial|   8|    100000|     100|0.05490760|  PASSED
              sts_serial|   8|    100000|     100|0.46844079|  PASSED
              sts_serial|   9|    100000|     100|0.94170852|  PASSED
              sts_serial|   9|    100000|     100|0.37246207|  PASSED
              sts_serial|  10|    100000|     100|0.78708430|  PASSED
              sts_serial|  10|    100000|     100|0.43940563|  PASSED
              sts_serial|  11|    100000|     100|0.95682412|  PASSED
              sts_serial|  11|    100000|     100|0.91341183|  PASSED
              sts_serial|  12|    100000|     100|0.94059147|  PASSED
              sts_serial|  12|    100000|     100|0.91720462|  PASSED
              sts_serial|  13|    100000|     100|0.29977341|  PASSED
              sts_serial|  13|    100000|     100|0.80663660|  PASSED
              sts_serial|  14|    100000|     100|0.65174466|  PASSED
              sts_serial|  14|    100000|     100|0.10931696|  PASSED
              sts_serial|  15|    100000|     100|0.31703586|  PASSED
              sts_serial|  15|    100000|     100|0.03218640|  PASSED
              sts_serial|  16|    100000|     100|0.01650420|  PASSED
              sts_serial|  16|    100000|     100|0.21720490|  PASSED
             rgb_bitdist|   1|    100000|     100|0.96762642|  PASSED
             rgb_bitdist|   2|    100000|     100|0.52038768|  PASSED
             rgb_bitdist|   3|    100000|     100|0.75233658|  PASSED
             rgb_bitdist|   4|    100000|     100|0.37138772|  PASSED
             rgb_bitdist|   5|    100000|     100|0.88690941|  PASSED
             rgb_bitdist|   6|    100000|     100|0.64131006|  PASSED
    I'm cancelling at this point and trying something in addition
    Last edited by awsdert; 01-10-2020 at 04:59 PM.

  13. #28
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    713
    I just noticed this part of your dieharder output (from 10 hours ago):

    Code:
       rng_name    |rands/second|   Seed   |
            mt19937|  7.47e+07  |2183355501|
    It looks like dieharder is using the "mt19937" RNG by default (the man page for dieharder confirms this). That is the "Mersenne Twister" using 19937 bits of state. This is a pretty good RNG, as you can see from dieharder's analysis.

    Edit to add: you need to call dieharder with the "-g 200" option to make it read your "random" data on standard input.
    Last edited by christop; 01-10-2020 at 04:58 PM.

  14. #29
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    27,560
    Quote Originally Posted by awsdert
    Been reading the docs and seems to be fine with stdin but to satisfy your curiosity I'll try it when I get home
    stahta01's manual extract confirms my example, except that you might want to look at whether the other options are relevant. The pipe does use stdin: recall that it pipes the output of your program (to stdout) as input to the other program (as stdin). If you really did run those tests with input redirection instead of piping though, then it would seem that this utility ran statistical tests on an executable program rather than the output of said program... I'd have thought that the content of an executable wouldn't be statistically random enough, but oh well.

    EDIT:
    Quote Originally Posted by christop
    It looks like dieharder is using the "mt19937" RNG by default (the man page for dieharder confirms this). That is the "Mersenne Twister" using 19937 bits of state. This is a pretty good RNG, as you can see from dieharder's analysis.
    So the utility just discarded what was fed to it via standard input?
    Last edited by laserlight; 01-10-2020 at 05:02 PM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #30
    Registered User awsdert's Avatar
    Join Date
    Jan 2015
    Posts
    873
    Well the change at least caused a pass on some previously failed tests
    Code:
    make --no-print-directory dieharder_rnd
    gcc -ggdb -Wall -lpthread -DBUILD_FOR_DIEHARDER -o ./mcc_rnd_die.elf mcc_rnd.c
    ./mcc_rnd_die.elf > diehard.txt
    dieharder -a -f diehard.txt -t 100 -Y 1
    #=============================================================================#
    #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
    #=============================================================================#
       rng_name    |           filename             |rands/second|
            mt19937|                     diehard.txt|  7.96e+07  |
    #=============================================================================#
            test_name   |ntup| tsamples |psamples|  p-value |Assessment
    #=============================================================================#
       diehard_birthdays|   0|       100|     100|0.92161723|  PASSED
          diehard_operm5|   0|   1000000|     100|0.95034250|  PASSED
      diehard_rank_32x32|   0|     40000|     100|0.04762000|  PASSED
        diehard_rank_6x8|   0|    100000|     100|0.98629424|  PASSED
       diehard_bitstream|   0|   2097152|     100|0.68113481|  PASSED
            diehard_opso|   0|   2097152|     100|0.82427499|  PASSED
            diehard_oqso|   0|   2097152|     100|0.73382595|  PASSED
             diehard_dna|   0|   2097152|     100|0.80381661|  PASSED
    diehard_count_1s_str|   0|    256000|     100|0.88826073|  PASSED
    diehard_count_1s_byt|   0|    256000|     100|0.69131699|  PASSED
     diehard_parking_lot|   0|     12000|     100|0.42137346|  PASSED
        diehard_2dsphere|   2|      8000|     100|0.78353142|  PASSED
        diehard_3dsphere|   3|      4000|     100|0.83751604|  PASSED
         diehard_squeeze|   0|    100000|     100|0.97324599|  PASSED
            diehard_sums|   0|       100|     100|0.03890804|  PASSED
            diehard_runs|   0|    100000|     100|0.37897033|  PASSED
            diehard_runs|   0|    100000|     100|0.28134077|  PASSED
           diehard_craps|   0|    200000|     100|0.98255307|  PASSED
           diehard_craps|   0|    200000|     100|0.19981783|  PASSED
     marsaglia_tsang_gcd|   0|  10000000|     100|0.52946603|  PASSED
     marsaglia_tsang_gcd|   0|  10000000|     100|0.11235286|  PASSED
             sts_monobit|   1|    100000|     100|0.94853669|  PASSED
                sts_runs|   2|    100000|     100|0.98915854|  PASSED
              sts_serial|   1|    100000|     100|0.53037634|  PASSED
              sts_serial|   2|    100000|     100|0.99259101|  PASSED
              sts_serial|   3|    100000|     100|0.69499416|  PASSED
              sts_serial|   3|    100000|     100|0.25469722|  PASSED
              sts_serial|   4|    100000|     100|0.31794760|  PASSED
              sts_serial|   4|    100000|     100|0.65630293|  PASSED
              sts_serial|   5|    100000|     100|0.10030703|  PASSED
              sts_serial|   5|    100000|     100|0.33876643|  PASSED
              sts_serial|   6|    100000|     100|0.11512964|  PASSED
              sts_serial|   6|    100000|     100|0.92113071|  PASSED
              sts_serial|   7|    100000|     100|0.35443944|  PASSED
              sts_serial|   7|    100000|     100|0.73691352|  PASSED
              sts_serial|   8|    100000|     100|0.80353276|  PASSED
              sts_serial|   8|    100000|     100|0.86551832|  PASSED
              sts_serial|   9|    100000|     100|0.93505112|  PASSED
              sts_serial|   9|    100000|     100|0.98897060|  PASSED
              sts_serial|  10|    100000|     100|0.84157456|  PASSED
              sts_serial|  10|    100000|     100|0.89642801|  PASSED
              sts_serial|  11|    100000|     100|0.94733618|  PASSED
              sts_serial|  11|    100000|     100|0.88809914|  PASSED
              sts_serial|  12|    100000|     100|0.62251654|  PASSED
              sts_serial|  12|    100000|     100|0.74017302|  PASSED
              sts_serial|  13|    100000|     100|0.61114068|  PASSED
              sts_serial|  13|    100000|     100|0.70827034|  PASSED
              sts_serial|  14|    100000|     100|0.99409109|  PASSED
              sts_serial|  14|    100000|     100|0.86867344|  PASSED
              sts_serial|  15|    100000|     100|0.87824157|  PASSED
              sts_serial|  15|    100000|     100|0.60437611|  PASSED
              sts_serial|  16|    100000|     100|0.65594647|  PASSED
              sts_serial|  16|    100000|     100|0.91562830|  PASSED
             rgb_bitdist|   1|    100000|     100|0.30958867|  PASSED
             rgb_bitdist|   2|    100000|     100|0.63426304|  PASSED
             rgb_bitdist|   3|    100000|     100|0.14087628|  PASSED
             rgb_bitdist|   4|    100000|     100|0.07156920|  PASSED
             rgb_bitdist|   5|    100000|     100|0.13166009|  PASSED
             rgb_bitdist|   6|    100000|     100|0.10396914|  PASSED
             rgb_bitdist|   7|    100000|     100|0.85533507|  PASSED
             rgb_bitdist|   8|    100000|     100|0.76165246|  PASSED
             rgb_bitdist|   9|    100000|     100|0.90668495|  PASSED
             rgb_bitdist|  10|    100000|     100|0.81370263|  PASSED
             rgb_bitdist|  11|    100000|     100|0.56225235|  PASSED
             rgb_bitdist|  12|    100000|     100|0.62578504|  PASSED
    rgb_minimum_distance|   2|     10000|    1000|0.14524290|  PASSED
    rgb_minimum_distance|   3|     10000|    1000|0.71798653|  PASSED
    rgb_minimum_distance|   4|     10000|    1000|0.62044967|  PASSED
    rgb_minimum_distance|   5|     10000|    1000|0.92519925|  PASSED
        rgb_permutations|   2|    100000|     100|0.80781758|  PASSED
        rgb_permutations|   3|    100000|     100|0.22465441|  PASSED
        rgb_permutations|   4|    100000|     100|0.06486625|  PASSED
        rgb_permutations|   5|    100000|     100|0.88229895|  PASSED
          rgb_lagged_sum|   0|   1000000|     100|0.29016285|  PASSED
          rgb_lagged_sum|   1|   1000000|     100|0.44218168|  PASSED
          rgb_lagged_sum|   2|   1000000|     100|0.87158911|  PASSED
          rgb_lagged_sum|   3|   1000000|     100|0.40383383|  PASSED
          rgb_lagged_sum|   4|   1000000|     100|0.20346561|  PASSED
          rgb_lagged_sum|   5|   1000000|     100|0.06987294|  PASSED
          rgb_lagged_sum|   6|   1000000|     100|0.96547707|  PASSED
          rgb_lagged_sum|   7|   1000000|     100|0.65228771|  PASSED
          rgb_lagged_sum|   8|   1000000|     100|0.49786721|  PASSED
          rgb_lagged_sum|   9|   1000000|     100|0.03422759|  PASSED
          rgb_lagged_sum|  10|   1000000|     100|0.34623429|  PASSED
          rgb_lagged_sum|  11|   1000000|     100|0.34719122|  PASSED
          rgb_lagged_sum|  12|   1000000|     100|0.37062504|  PASSED
          rgb_lagged_sum|  13|   1000000|     100|0.74491138|  PASSED
          rgb_lagged_sum|  14|   1000000|     100|0.88931778|  PASSED
          rgb_lagged_sum|  15|   1000000|     100|0.13501736|  PASSED
          rgb_lagged_sum|  16|   1000000|     100|0.06369016|  PASSED
          rgb_lagged_sum|  17|   1000000|     100|0.88156651|  PASSED
          rgb_lagged_sum|  18|   1000000|     100|0.51469867|  PASSED
          rgb_lagged_sum|  19|   1000000|     100|0.16741199|  PASSED
          rgb_lagged_sum|  20|   1000000|     100|0.42849592|  PASSED
          rgb_lagged_sum|  21|   1000000|     100|0.40387072|  PASSED
          rgb_lagged_sum|  22|   1000000|     100|0.25274004|  PASSED
          rgb_lagged_sum|  23|   1000000|     100|0.28240284|  PASSED
          rgb_lagged_sum|  24|   1000000|     100|0.66642375|  PASSED
          rgb_lagged_sum|  25|   1000000|     100|0.83348324|  PASSED
          rgb_lagged_sum|  26|   1000000|     100|0.39567244|  PASSED
          rgb_lagged_sum|  27|   1000000|     100|0.98195499|  PASSED
          rgb_lagged_sum|  28|   1000000|     100|0.04585665|  PASSED
          rgb_lagged_sum|  29|   1000000|     100|0.98016458|  PASSED
          rgb_lagged_sum|  30|   1000000|     100|0.99756248|   WEAK
          rgb_lagged_sum|  30|   1000000|     200|0.97082170|  PASSED
          rgb_lagged_sum|  31|   1000000|     100|0.61949755|  PASSED
          rgb_lagged_sum|  32|   1000000|     100|0.72894547|  PASSED
         rgb_kstest_test|   0|     10000|    1000|0.09472064|  PASSED
         dab_bytedistrib|   0|  51200000|       1|0.27907397|  PASSED
                 dab_dct| 256|     50000|       1|0.64134898|  PASSED
    Preparing to run test 207.  ntuple = 0
            dab_filltree|  32|  15000000|       1|0.97399778|  PASSED
            dab_filltree|  32|  15000000|       1|0.95593012|  PASSED
    Preparing to run test 208.  ntuple = 0
           dab_filltree2|   0|   5000000|       1|0.01867152|  PASSED
           dab_filltree2|   1|   5000000|       1|0.23876266|  PASSED
    Preparing to run test 209.  ntuple = 0
            dab_monobit2|  12|  65000000|       1|0.35946069|  PASSED
    Compilation finished successfully.
    Still running, for reference the change I made is this:
    Code:
    return val;
    to this:
    Code:
    return val >> (val % (sizeof(long) * CHAR_BIT));
    in the ulong version
    Last edited by awsdert; 01-10-2020 at 05:30 PM. Reason: Updated output again

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need a random number generator thats not compleatly random
    By thedodgeruk in forum C++ Programming
    Replies: 1
    Last Post: 06-05-2011, 06:48 AM
  2. Replies: 5
    Last Post: 10-05-2009, 10:21 AM
  3. Replies: 2
    Last Post: 12-25-2003, 01:31 AM
  4. random number between negative and positive number
    By anomaly in forum C++ Programming
    Replies: 6
    Last Post: 12-06-2003, 08:40 AM
  5. Random Number problem in number guessing game...
    By -leech- in forum Windows Programming
    Replies: 8
    Last Post: 01-15-2002, 05:00 PM

Tags for this Thread