You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently ChuckSomeDice really doesn't like non-integers, as this code:
G'DAY MATE!
IMPOHT ME FUNC ChuckSomeDice;
ChuckSomeDice(0, 0.5);
CHEERS C***!
outputs the following error:
thread 'main' panicked at 'cannot sample empty range', /Users/zackradisic/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.8.4/src/rng.rs:134:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The text was updated successfully, but these errors were encountered:
I know there's a PR for this, but just want to add that ChuckSomeDice is basically a fancy alias for rand() which only takes integers anyway (specifically, the datatype is an i64) so you'd expect 0.5 to truncate to just 0, per integer truncating.
The bug, of course, is that ChuckSomeDice(0,0) should display the proper error message, which is what ^this PR will fix, and you do reference this in the PR itself.
Apparently
ChuckSomeDice
really doesn't like non-integers, as this code:outputs the following error:
The text was updated successfully, but these errors were encountered: