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

randNumeric returns values that are interpreted as octal #31

Open
danielhoherd opened this issue Oct 20, 2020 · 0 comments
Open

randNumeric returns values that are interpreted as octal #31

danielhoherd opened this issue Oct 20, 2020 · 0 comments

Comments

@danielhoherd
Copy link

randNumeric returns values that are interpreted as octal. This causes problems when randNumeric returns numbers that are invalid octal numbers, like 08 and 09. Errors related to this happen silently when passed to mul and div, resulting in random numbers that are heavily weighted to 0.

EG: when running 1000 iterations of {{ mul (randNumeric 2) 6 }}, the top 5 chosen numbers and their count were:

number times chosen
30 16
156 17
24 17
468 18
0 36

When attempting things like {{ mul 08 6 }}, {{ div 09 3 }} a parse error arises, but when the octal numbers are generated by randNumeric the octal numbers are accepted and no error is seen.

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

No branches or pull requests

1 participant