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

refine testcase for random #2543

Merged
merged 1 commit into from
Feb 18, 2024
Merged

refine testcase for random #2543

merged 1 commit into from
Feb 18, 2024

Conversation

syheliel
Copy link
Contributor

Fix issue #2542 . test the distribution of random. The error rate is lower than 0.1% (tested locally 1000 times without fail)

@certik
Copy link
Contributor

certik commented Feb 18, 2024

For me the random number seed is always the same, so I get always the same answer.

The test works fine, but we need to ensure the random seed is initialized using the system clock at the beginning of the program. That's a separate issue.

The test itself is good. If it ever fails, we can relax the 5% deviation to a higher number. Thanks!

@certik certik merged commit 5c7e247 into lcompilers:main Feb 18, 2024
13 checks passed
@certik
Copy link
Contributor

certik commented Feb 18, 2024

While playing with this code, I discovered two bugs:

The second one is just a bug in LPython. The first one however is a bug in the random seed initialization. We need to fix it.

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