-
Notifications
You must be signed in to change notification settings - Fork 2
from_seed
should not panic
#4
Comments
I fixed and also made sure that the xoshiro generators are not initialized with all zeros in 0.4. |
Okay. That's slightly obscure (i.e. might not be obvious to others what happens) but does the job. |
I'm not sure what you mean. What would be a less obscure alternative? |
Choose a substitute seed directly instead of referring to another function which essentially just picks a different seed for you. Mr Dicker had fun with hex constants here ("odd biases", "bad seed") but it doesn't really matter what. Potentially the compiler can constantise the function result anyway; I just thought it odd that you're essentially just picking another seed value but not admitting it. |
I'm confused, this is exactly what I'm saying in the docs: /// Create a new `Xoshiro256StarStar`. If `seed` is entirely 0, it will be
/// mapped to a different seed. There are two reasons I didn't pick magic constants:
|
xoshiro/src/xoroshiro128plus.rs
Line 93 in 56abee4
from_seed
does not have error handling, and we decided that it shouldn't panic doc.Compare with this implementation.
The text was updated successfully, but these errors were encountered: