Skip to content

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

Merged
Jeehut merged 2 commits intoFlineDev:stablefrom
knothed:work/rng
Mar 25, 2020
Merged

Add custom RandomNumberGenerator source to Int.init?(randomBelow:)#44
Jeehut merged 2 commits intoFlineDev:stablefrom
knothed:work/rng

Conversation

@knothed
Copy link
Copy Markdown
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
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants