Skip to content

Add note that seed should be non-zero #867

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

Merged
merged 2 commits into from
May 8, 2022
Merged

Add note that seed should be non-zero #867

merged 2 commits into from
May 8, 2022

Conversation

redfast00
Copy link
Contributor

After losing about a half hour debugging why my code wasn't deterministic when it should be, I found out that randomSeed doesn't do anything when the seed is zero (https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/WMath.cpp#L30)

After losing about a half hour debugging why my code wasn't deterministic when it should be, I found out that `randomSeed` doesn't do anything when the `seed` is zero (https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/WMath.cpp#L30)
@CLAassistant
Copy link

CLAassistant commented Jan 19, 2022

CLA assistant check
All committers have signed the CLA.

@redfast00
Copy link
Contributor Author

Maybe it's useful to have a sort of warning banner/markup instead?

@per1234 per1234 self-assigned this May 7, 2022
@per1234
Copy link
Collaborator

per1234 commented May 8, 2022

Related discussion: arduino/Arduino#3887

Copy link
Collaborator

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks for this valuable improvement @redfast00!

@per1234 per1234 merged commit a7fe5ef into arduino:master May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants