Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@LeeBadal
Copy link

Issue

Current behaviour of (get-random-int {seed} 0) returns a divide by zero error (see below):
div0

Proposed solution

The proposed solution is to default the random integer to 0 when this occurs, but still return a new seed value.

Justification

This is the behaviour of the built-in rand-int function & it resonates with the default behaviour most would expect from supplying 0 as the max value.

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.

1 participant