Skip to content

Random int implementation doesn't match documentation #9

@gliderman

Description

@gliderman

The documentation shows the random_int(min, max) returns a number from min (inclusive) to max (exclusive). However, the implementation provides a number from min (inclusive) to max (inclusive). Most random number generators return numbers inclusive to exclusive. There is also a concern that if the number passed for max is already the maximum uint16_t, when the function adds 1 it will overflow.

This is a suggestion for maybe somebody to do in a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions