Skip to content

Commit 4c3aa5d

Browse files
Jorropogopherbot
authored andcommitted
math/rand/v2: replace <= 0 with == 0 for Uint function docs
This harmonize the docs with (*Rand).Uint* functions. And it make it clearer, I wasn't sure if it would try to interpret the uint as a signed number somehow, it does not pull any surprises make that clear. Change-Id: I5a87a0a5563dbabfc31e536e40ee69b11f5cb6cf Reviewed-on: https://go-review.googlesource.com/c/go/+/633535 LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent ccf4ebb commit 4c3aa5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/math/rand/v2/rand.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ func Uint32() uint32 { return globalRand.Uint32() }
275275

276276
// Uint64N returns, as a uint64, a pseudo-random number in the half-open interval [0,n)
277277
// from the default Source.
278-
// It panics if n <= 0.
278+
// It panics if n == 0.
279279
func Uint64N(n uint64) uint64 { return globalRand.Uint64N(n) }
280280

281281
// Uint32N returns, as a uint32, a pseudo-random number in the half-open interval [0,n)
282282
// from the default Source.
283-
// It panics if n <= 0.
283+
// It panics if n == 0.
284284
func Uint32N(n uint32) uint32 { return globalRand.Uint32N(n) }
285285

286286
// Uint64 returns a pseudo-random 64-bit value as a uint64
@@ -314,7 +314,7 @@ func IntN(n int) int { return globalRand.IntN(n) }
314314

315315
// UintN returns, as a uint, a pseudo-random number in the half-open interval [0,n)
316316
// from the default Source.
317-
// It panics if n <= 0.
317+
// It panics if n == 0.
318318
func UintN(n uint) uint { return globalRand.UintN(n) }
319319

320320
// N returns a pseudo-random number in the half-open interval [0,n) from the default Source.

0 commit comments

Comments
 (0)