]> Cypherpunks repositories - gostls13.git/commitdiff
math/rand/v2: replace <= 0 with == 0 for Uint function docs
authorJorropo <jorropo.pgm@gmail.com>
Wed, 4 Dec 2024 12:07:08 +0000 (13:07 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 4 Dec 2024 16:34:07 +0000 (16:34 +0000)
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
src/math/rand/v2/rand.go

index fea1e3a2ba200b47832128db23dd61f54d672fcd..f6b2e4754fa773b83d1375c863bea9ae1a9be56e 100644 (file)
@@ -275,12 +275,12 @@ func Uint32() uint32 { return globalRand.Uint32() }
 
 // Uint64N returns, as a uint64, a pseudo-random number in the half-open interval [0,n)
 // from the default Source.
-// It panics if n <= 0.
+// It panics if n == 0.
 func Uint64N(n uint64) uint64 { return globalRand.Uint64N(n) }
 
 // Uint32N returns, as a uint32, a pseudo-random number in the half-open interval [0,n)
 // from the default Source.
-// It panics if n <= 0.
+// It panics if n == 0.
 func Uint32N(n uint32) uint32 { return globalRand.Uint32N(n) }
 
 // Uint64 returns a pseudo-random 64-bit value as a uint64
@@ -314,7 +314,7 @@ func IntN(n int) int { return globalRand.IntN(n) }
 
 // UintN returns, as a uint, a pseudo-random number in the half-open interval [0,n)
 // from the default Source.
-// It panics if n <= 0.
+// It panics if n == 0.
 func UintN(n uint) uint { return globalRand.UintN(n) }
 
 // N returns a pseudo-random number in the half-open interval [0,n) from the default Source.