]> Cypherpunks repositories - gostls13.git/commit
math/rand: Intn etc. should panic if their argument is <= 0.
authorRob Pike <r@golang.org>
Fri, 17 Feb 2012 21:53:03 +0000 (08:53 +1100)
committerRob Pike <r@golang.org>
Fri, 17 Feb 2012 21:53:03 +0000 (08:53 +1100)
commit7d1c5328ed2b0082acdc0b47e6565e4b254e9f8c
tree56481b47e313ee13fc532b86809b531306f69d02
parent566e0fe785b38cbcef588d3439ada87235737898
math/rand: Intn etc. should panic if their argument is <= 0.

I am making a unilateral decision here. I could also settle for returning 0,
as long it's documented, but I argue that it's equivalent to an index
out of bounds.

Fixes #2892.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5676079
src/pkg/math/rand/rand.go