• Russ Cox's avatar
    undo CL 6845121 / 79603a5e4cda · ff2534e0
    Russ Cox authored
    This changes the output of
    
    rand.Seed(0)
    perm := rand.Perm(100)
    
    When giving the same seeds to Go 1.0 and Go 1.1 programs
    I would like them to generate the same random numbers.
    
    ««« original CL description
    math/rand: remove noop iteration in Perm
    
    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
    
    »»»
    
    R=golang-dev, bradfitz
    CC=golang-dev
    https://golang.org/cl/6905049
    ff2534e0
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
exp Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
old/netchan Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...