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

Consistent behavior of GetRandom{numeric} #24

Closed
fluffynuts opened this issue Feb 22, 2020 · 0 comments
Closed

Consistent behavior of GetRandom{numeric} #24

fluffynuts opened this issue Feb 22, 2020 · 0 comments

Comments

@fluffynuts
Copy link
Owner

GetRandom{Int|Long|Decimal|Float|Double) should be friendlier when providing only a lower-bound for the range of acceptable values, and, instead of using the default parameter value and then potentially swapping them, should rather use the default range, added onto the minimum

ie if the user asks for GetRandomInt(100), then she probably expects a number of value at least 100, but the current implementation defaults the max to 10 and tries to protect the caller against accidental flipping of min & max, so the call above results in a number between 10 and 100 (inclusive). Probably not the original intention of the call, and not clear.

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