Skip to content

randNumeric returns values that are interpreted as octal #31

@danielhoherd

Description

@danielhoherd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions