]> Cypherpunks repositories - gostls13.git/commitdiff
math/rand: improve package documentation
authorBenjamin Cable <cable.benjamin@gmail.com>
Thu, 2 Aug 2018 13:54:16 +0000 (14:54 +0100)
committerRob Pike <r@golang.org>
Fri, 3 Aug 2018 23:08:42 +0000 (23:08 +0000)
Notify readers that interval notation is used.
Fixes: #26765
Change-Id: Id02a7fcffbf41699e85631badeee083f5d4b2201
Reviewed-on: https://go-review.googlesource.com/127549
Reviewed-by: Rob Pike <r@golang.org>
src/math/rand/normal.go
src/math/rand/rand.go

index ba4ea54cace6801417858053441bcf97b0845cab..2c5a7aa99b8917d894855aafc1870d4e1c6ee74b 100644 (file)
@@ -27,9 +27,9 @@ func absInt32(i int32) uint32 {
        return uint32(i)
 }
 
-// NormFloat64 returns a normally distributed float64 in the range
-// [-math.MaxFloat64, +math.MaxFloat64] with
-// standard normal distribution (mean = 0, stddev = 1).
+// NormFloat64 returns a normally distributed float64 in
+// the range -math.MaxFloat64 through +math.MaxFloat64 inclusive,
+// with standard normal distribution (mean = 0, stddev = 1).
 // To produce a different normal distribution, callers can
 // adjust the output using:
 //
index 147c92f9e257e3270b936079d68d75d840db6dc6..04382e6208887e2df1e2cdcf12e3fae0abdb15bd 100644 (file)
@@ -11,6 +11,9 @@
 // The default Source is safe for concurrent use by multiple goroutines, but
 // Sources created by NewSource are not.
 //
+// Mathematical interval notation such as [0, n) is used throughout the
+// documentation for this package.
+//
 // For random numbers suitable for security-sensitive work, see the crypto/rand
 // package.
 package rand