-
Notifications
You must be signed in to change notification settings - Fork 33
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
Random.int added #773
base: main
Are you sure you want to change the base?
Random.int added #773
Conversation
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.
Test
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 once tests pass
counts[random_number as usize] += 1; | ||
} | ||
|
||
let lower_bound = 0.90 * NUM_ITERATION as f64 / MAX_VALUE as f64; |
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.
I don't know math but seems okay.
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 besides typo! id maybe widen your tests bounds a little just to make the test less flaky however. either that or increase the number of iterations.
docs/_docs/user-guide/eldritch.md
Outdated
@@ -692,6 +692,12 @@ The random library is designed to enable generation of cryptogrphically secure r | |||
|
|||
The <b>random.bool</b> method returns a randomly sourced boolean value. | |||
|
|||
### radnom.int |
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.
nit: spelling
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.
Fixed
What type of PR is this?
/kind documentation
/kind feature
/kind eldritch-function
What this PR does / why we need it:
Adds random.int function to generate a secure random int
Which issue(s) this PR fixes:
Fixes #759