Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/25/03 22:11
Read: times


 
#61391 - RE: Random number from 1 to 8
Responding to: ???'s previous message
Oleg Sergeev wrote:
-------------------------------
newRand = 1 + rand()%8;or
newRand = 1 + rand()&7;

I think 1 + rand() & 7 is wrong because this way all the random numbers above 7 are same as 7, ie I get 7 for newRand most of the time if you see what I mean.
I need good distribution of newRand.

1 + rand()%8 I have to think about, thanks.
Your idea of hardware random number generator is great, but since this project is for promotion and I'm not getting paid I have to do minimum effort, thats why my requirement is just to use rand function and no extra hardware.
Mahmood



List of 39 messages in thread
TopicAuthorDate
Random number from 1 to 8            01/01/70 00:00      
   P.S            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      
      RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      
      RE: Random number from 1 to 8            01/01/70 00:00      
         RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
            RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
               RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
                     RE: Random number from 1 to 8            01/01/70 00:00      
                  RE: Random number from 1 to 8            01/01/70 00:00      
   Prime polynomials over GFn            01/01/70 00:00      
   ways to get the pseudo out            01/01/70 00:00      
      RE: ways to get the pseudo out            01/01/70 00:00      
         RE: ways to get the pseudo out            01/01/70 00:00      
            RE: ways to get the pseudo out            01/01/70 00:00      
               RE: ways to get the pseudo out            01/01/70 00:00      
                  RE: ways to get the pseudo out            01/01/70 00:00      
                     RE: ways to get the pseudo out            01/01/70 00:00      
                        RE: ways to get the pseudo out            01/01/70 00:00      
                           RE: ways to get the pseudo out            01/01/70 00:00      
   RE: Random number from 1 to 8            01/01/70 00:00      

Back to Subject List