:
:Matthew Dillon wrote:
:>     For example, prime number 3 an array size 8 will scan the array in
:>     the following order  N = (N + PRIME) & (ARRAY_SIZE_MASK).
:>     N = (N + 3) & 7:
:> 
:>     0 3 6 1 4 7 2 5 ... 0
:> 
:>     As you can see, all the array entries are covered before the sequence
:>     repeats. ....  Only certain prime number / power-of-2-array size
:>     combinations have this effect,   ....
:
:Ummmm....  Actually, Matt, the property you've stated is much more
:common than you seem to believe.  If you generate a sequence
:    N = ( N + Stride ) % ArraySize
:then you will visit every element of (0 ... ArraySize-1) as long as

    I was just answering a question.  Most people aren't interested in that
    level of detail (or, if they are, I'm sure Terry would happily chime in),
    they just want to know the purpose.

                                                        -Matt

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to