Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add custom RandomNumberGenerator source to Int.init?(randomBelow:) #44

Merged
merged 2 commits into from
Mar 25, 2020
Merged

Add custom RandomNumberGenerator source to Int.init?(randomBelow:) #44

merged 2 commits into from
Mar 25, 2020

Conversation

knothed
Copy link
Contributor

@knothed knothed commented Mar 2, 2020

This allows users to provide the RNG of their choice for creating pseudo-random integers.

I.e., instead of

let values = 100.timesMake { Int(randomBelow: 10) }

users could write:

var xoshiro = Xoshiro() // Some third-party RNG
let values = 100.timesMake { Int(randomBelow: 10, using: &xoshiro) }

knothed added 2 commits March 2, 2020 14:11
This allows users to provide the RNG of their choice for creating pseudo-random integers.
Copy link
Member

@Jeehut Jeehut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, merging. Thank you very much!

@Jeehut Jeehut merged commit 1391e1c into FlineDev:stable Mar 25, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants