-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve documentation for random #17015
Conversation
Use runnableExamples Minor changes
we should simply fix the compiler instead of using a workaround. Shouldn't be too hard IMO EDIT: but please file a bug, ideally with a minimized example |
Done, see #17016. |
Remove echo Use RNG in more places
## * `stats module<stats.html>`_ for statistical analysis | ||
## * `list of cryptographic and hashing modules | ||
## <lib.html#pure-libraries-hashing>`_ | ||
## * `std/sysrand module <sysrand.html>`_ for a cryptographically secure pseudorandom number generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## * `std/sysrand module <sysrand.html>`_ for a cryptographically secure pseudorandom number generator | |
## * `std/sysrand module <sysrand.html>`_ for a cryptographically secure pseudorandom number generator (CSPRNG) |
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer | ||
## * `rand proc<#rand,Rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_ | ||
## that accepts a slice | ||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type | ||
runnableExamples: | ||
var r = initRand(234) | ||
let f = r.rand(1.0) | ||
## f = 8.717181376738381e-07 | ||
let f = r.rand(1.0) # 8.717181376738381e-07 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-existing but that's a bug (doesn't affect this PR though); will explain later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's: timotheecour#435
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; remaining points can be addressed in future PRs
* Improve documentation for random Use runnableExamples Minor changes * Apply suggestions Remove echo Use RNG in more places * Fix skipRandomNumbers example
runnableExamples
I noticed that the documentation for
initRand(int64)
is generated twice (see #16953 (comment)), if anybody knows a workaround for this, please let me know.