math/rand: improve package documentation

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>
This commit is contained in:
Benjamin Cable 2018-08-02 14:54:16 +01:00 committed by Rob Pike
parent 07bcfe5745
commit 669ac1228a
2 changed files with 6 additions and 3 deletions

View 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:
//

View 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