randRange limit?

#1

Example:

<cfset randA=#randRange(98632500001273, 23768951248743981237)# />
<cfset randB=#randRange(2165325874090972535392394,98932721530935635835067365734662)# />
<cfset randC=#randRange(randA, randB)# />

Result for all three values is always 2147483647

So, I’m guessing there is a limit as to the size of number that randRange can generate?

0 Likes

#2

check if this can help you: http://ryanguill.com/cfml/math/2016/02/21/a-better-randrange.html

0 Likes

#3

Thank you! For now I settled on accepting a range between 9xx,xxx and 9xx,xxx,xxx,xxx and then hashing that rand result to SHA2, 256. But I will come back to this and implement when I get a break. Thanks!

0 Likes

#4

please vote for the bug https://luceeserver.atlassian.net/browse/LDEV-25

0 Likes

#5

OK, I feel pretty dumb - but I can’t find a way to vote on that link.

0 Likes

#6

are you logged in? you can vote at the top right under reporter

0 Likes

#7

Missing one of those icons. Let me find log in

0 Likes

#8

Done

0 Likes