Skip to content

math/rand: documentation on rng.go is lacking important context and information #36133

@Plazmaz

Description

@Plazmaz

Does this issue reproduce with the latest release?

Yes

What did you expect to see?

Details about the algorithm used, links to source material, context about why this algorithm was used and how it differs from other methods.

What did you see instead?

go/src/math/rand/rng.go

Lines 7 to 12 in c2edcf4

/*
* Uniform distribution
*
* algorithm by
* DP Mitchell and JA Reeds
*/

A single vague comment listing two names, without the title of sources used, the name of the algorithm used, or any details whatsoever. The names alone don't seem to be sufficient for finding the source material (at least based on a good amount of googling)
It seems like I'm not the only person having this issue:
https://www.seehuhn.de/blog/134.html

Could provide some more context on what algorithm is being used, why it was chosen, and how it differs from something like mersenne twister? I think it would be valuable knowledge, and a good addition to that documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions