Skip to content
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

fix #17467 1st call to rand is now non-skewed; allow seed == 0 #17468

Merged
merged 7 commits into from
May 11, 2021

Conversation

timotheecour
Copy link
Member

@timotheecour timotheecour commented Mar 23, 2021

@timotheecour timotheecour force-pushed the pr_fix_trandom branch 2 times, most recently from 6cc35fd to ecf4454 Compare March 23, 2021 08:33
lib/pure/random.nim Outdated Show resolved Hide resolved
@timotheecour timotheecour changed the title fix #17467 1st call to rand is now non-skewed fix #17467 1st call to rand is now non-skewed; allow seed = 0 Mar 23, 2021
@timotheecour timotheecour changed the title fix #17467 1st call to rand is now non-skewed; allow seed = 0 fix #17467 1st call to rand is now non-skewed; allow seed == 0 Mar 23, 2021
@timotheecour timotheecour force-pushed the pr_fix_trandom branch 2 times, most recently from 530d454 to e2c6d04 Compare March 23, 2021 22:54
@timotheecour timotheecour requested a review from ringabout March 23, 2021 22:55
changelog.md Outdated Show resolved Hide resolved
@timotheecour timotheecour marked this pull request as draft March 24, 2021 07:11
@juancarlospaco
Copy link
Collaborator

What are the benefits of seed 0 ?, would it be better to enforce a non-zero seed ?.

@timotheecour
Copy link
Member Author

timotheecour commented May 4, 2021

What are the benefits of seed 0 ?, would it be better to enforce a non-zero seed ?.

simpler API with less edge cases.
PTAL

@timotheecour timotheecour marked this pull request as ready for review May 4, 2021 02:39
@timotheecour timotheecour added the Ready For Review (please take another look): ready for next review round label May 4, 2021
@timotheecour timotheecour requested a review from Araq May 11, 2021 01:20
@Araq Araq merged commit 4549049 into nim-lang:devel May 11, 2021
@timotheecour timotheecour deleted the pr_fix_trandom branch May 11, 2021 14:27
PMunch pushed a commit to PMunch/Nim that referenced this pull request Mar 28, 2022
nim-lang#17468)

* fix nim-lang#17467 1st call to rand is now non-skewed; allow passing 0 as seed

* changelog + fallback

* document behavior for seed == 0

* address comments

* _

* fix tests, disable kdtree

* re-enable kdtree with -d:nimLegacyRandomInitRand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review (please take another look): ready for next review round
Projects
None yet
5 participants