Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/rand: package docs don't explain the interval notation #34655

Closed
vabr-g opened this issue Oct 2, 2019 · 3 comments
Closed

math/rand: package docs don't explain the interval notation #34655

vabr-g opened this issue Oct 2, 2019 · 3 comments

Comments

@vabr-g
Copy link

vabr-g commented Oct 2, 2019

What version of Go are you using (go version)?

Whatever version the page at https://golang.org/pkg/math/rand/ is associated with.

Does this issue reproduce with the latest release?

It is present at the https://golang.org/pkg/math/rand/ page.

What operating system and processor architecture are you using (go env)?

Not relevant for reading docs.

What did you do?

Reading https://golang.org/pkg/math/rand/ I wanted to understand what interval notation the particular documentation page uses.

What did you expect to see?

"The documentation for this package uses interval notation with square brackets [, ] to denote included borders and round (, ) to denote excluded. For example, for n>0, [0, n) includes 0 but excludes n."

What did you see instead?

"Mathematical interval notation such as [0, n) is used throughout the documentation for this package."

I'm afraid there is no such thing as "mathematical interval notation". Different mathematicians define different notation. I propose that the mentioned documentation also properly defines the notation used in it. Ideally directly, or at least linking to the source of that notation.

@ianlancetaylor
Copy link
Contributor

The notation we use here is the one described at https://en.wikipedia.org/wiki/Interval_(mathematics)#Notations_for_intervals. That seems sufficiently well-known and standardized to me.

@ianlancetaylor ianlancetaylor changed the title The docs for package "math/rand" don't explain the interval notation math/rand: package docs don't explain the interval notation Oct 2, 2019
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Oct 2, 2019
@vabr-g
Copy link
Author

vabr-g commented Oct 2, 2019

Could the definition you linked to be at least linked to from the documentation itself?

@andybons
Copy link
Member

andybons commented Oct 2, 2019

Thanks for the issue.

Searching via Google for "interval notation" provides several results that cover this notation in depth (including the Wikipedia entry @ianlancetaylor provided).

Linking seems unnecessary. Sorry.

@andybons andybons closed this as completed Oct 2, 2019
@golang golang locked and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants