• Johan Euphrosine's avatar
    math/rand: remove noop iteration in Perm · d7b0f2a5
    Johan Euphrosine authored
    The first iteration always do `m[0], m[0] = m[0], m[0]`, because
    `rand.Intn(1)` is 0.
    
    fun note: IIRC in TAOCP version of this algorithm, `i` goes
    backward (n-1->1), meaning that the "already" shuffled part of the
    array is never altered betweens iterations, while in the current
    implementation the "not-yet" shuffled part of the array is
    conserved between iterations.
    
    R=golang-dev
    CC=golang-dev
    https://golang.org/cl/6845121
    d7b0f2a5
Name
Last commit
Last update
..
exp.go Loading commit data...
normal.go Loading commit data...
rand.go Loading commit data...
rand_test.go Loading commit data...
rng.go Loading commit data...
zipf.go Loading commit data...