Comments (4)
Sorry, I don't quite follow. If you know how to improve the documentation though, a contribution would be very welcome!
To answer your bullet points:
SeedableRng::seed_from_u64
is the easiest way to seed from an integer- Don't know what you mean here; you can't implement traits on typedefs anyway. You do have to "use" (import) traits.
- No; all the bits of
rand_core
(other than utilities for implementing new RNGs) are availble inrand
too - Yes, you should decide on a PRNG. Probably any of the ones we have are suitable for procedural generation, crypto or not (the main difference being crypto ones use more memory and batch their generation). If you want reproducible generation across library versions, then don't use
SmallRng
/StdRng
; you may want to look at therand_xoshiro
andrand_pcg
crates (first one isn't published yet but hopefully will be later today)
from book.
Thanks - the first example was especially useful!
I would have like to have found a "recipe" page in the docs with:
- the above example
- some of your remarks above
- and maybe notes on re-seeding in an interactive application
- with links to more in-depth section in the rand-book
I'd like to have a go at creating such a page for documentation, as thanks for your help. I'm not sure if the page would be best in the rand book, or in the main Rust Cookbook. What do you think?
Thanks again!
from book.
It's also worth noting that using gen_range
or the Uniform
distribution may be a little faster and more accurate than using gen()
and modifying/shifting the result. Here's an expanded example.
from book.
I'm not sure if the page would be best in the rand book, or in the main Rust Cookbook. What do you think?
Depends where people are more likely to look for such documentation?
The book as it stands was written fairly quickly to at least have some doc beyond the API. It could certainly be expanded significantly. I can't gauge what content all readers want and also don't currently want to contribute new content to the book myself, but if you would like to I would be happy to review.
from book.
Related Issues (13)
- "This is not a property of true randomness."
- Incorrect formula HOT 2
- Test code examples and links
- Claim about obsolescence of non-crypto PRNGs HOT 3
- Conversion to 64-bit float HOT 2
- Dead links to random number generators HOT 2
- "Crates and features" implies that `rand` subsumes `rand_chacha` HOT 5
- Mention DistString
- Example of what can go wrong with RNGs HOT 1
- Document how to run RNGs in parallel HOT 1
- Broken links due to rand_distr split
- Document how to make a type randomizable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from book.