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:31
Read: times


 
#61394 - RE: Random number from 1 to 8
Responding to: ???'s previous message
& operator is a bitwise operator while && is the logical AND. in your example you mean the & for bitwise.
I see what you mean now, by discarding the upper 5 bits I get a number from 0 to 7.
so it should be ok to do newRand = 1 + rand() & 7;
thanks

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