Skip to content

Commit

Permalink
Update document for Creating New Generators section (JuliaLang#33070)
Browse files Browse the repository at this point in the history
document what copy should do for RNG's, fixes JuliaLang#33008
  • Loading branch information
wenjie-p authored and fredrikekre committed Aug 30, 2019
1 parent 7bc7904 commit 1b90a88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stdlib/Random/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ The API is not clearly defined yet, but as a rule of thumb:
should be defined for this specific RNG, if they are needed;
2) other documented `rand` methods accepting an `AbstractRNG` should work out of the box,
(provided the methods from 1) what are relied on are implemented),
but can of course be specialized for this RNG if there is room for optimization.
but can of course be specialized for this RNG if there is room for optimization;
3) `copy` for pseudo-RNGs should return an independent copy that generates the exact same random sequence as the
original from that point when called in the same way. When this is not feasible (e.g. hardware-based RNGs),
`copy` must not be implemented.

Concerning 1), a `rand` method may happen to work automatically, but it's not officially
supported and may break without warnings in a subsequent release.
Expand Down

0 comments on commit 1b90a88

Please sign in to comment.