4 ms·
Most other random libraries, in whatever languages, do not even offer the option of this "right" version of initialization. They all just seed with a 32-bit int
by netheril96 8y ago
Most other random libraries, in whatever languages, do not even offer the option of this "right" version of initialization. They all just seed with a 32-bit integer. If you are content with those libraries, you should be content with a simple `std::mt19937{std::random_device{}()}`.
- whyever 8y agoI don't think this is true for modern languages. Rust seeds the whole state by default: https://docs.rs/rand/0.6.5/rand/ https://docs.rs/rand/0.6.5/rand/ Julia seems to seed 128 bits: https://github.com/JuliaLang/julia/blob/5741c7f53c5ea443bbd73cc5157b83de415c6d1b/stdlib/Random/src/RNGs.jl#L249 https://github.com/JuliaLang/julia/blob/5741c7f53c5ea443bbd7... However, your statement seems to apply to old languages: C# uses only 32 bits and the time for seeding: https://docs.microsoft.com/en-us/dotnet/api/system.random?view=netframework-4.8 https://docs.microsoft.com/en-us/dotnet/api/system.random?vi... Java only supports 48 bit seeds: https://docs.oracle.com/javase/8/docs/api/java/util/Random.html https://docs.oracle.com/javase/8/docs/api/java/util/Random.h...