Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Ryan Guill
Ryan GuillNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Priority
Created 31 January 2015 at 23:31
Updated 15 July 2024 at 15:39
randRange() only works with int's, but if you use a MAX_INT as the max value, it will overflow the integer and wrap around, giving you a value that is not between the supplied values:
example:
I propose a few tweaks.
Change to use longs instead of integers. I have the need to get random numbers much larger already.
Throw an error if the values are outside of expected ranges and would cause a return value outside of the provided range.
If it is acceptable to do both of these items, I would be happy to make the changes myself and submit a pull request for the code and a test.