Page 1 of 1
Ramdom
Posted: Wed Oct 28, 2009 6:50 am
by Kevin
I am passing a unsigned 64 bit integer as the upper limit to random and receiving "(random: error in source expression), char 4"
put random(18446744073709551615) into _random
What is the max random can take?
Posted: Wed Oct 28, 2009 10:17 am
by Mark
Hi Kevin,
The max value for an argument of the random function is 2^32-1. Don't ask me why, this was a choice made by RunRev.
Best,
Mark
Posted: Wed Oct 28, 2009 12:37 pm
by Mark Smith
I think it's simply that for some functions like random(), baseconvert() and the bitwise operators, the engine converts values to 4 byte unsigned integers.
Best,
Mark Smith
Posted: Wed Oct 28, 2009 1:17 pm
by Mark
And why doe the engine convert values to 4 byte unsigned integers, Mark? ;-)
Mark
Posted: Wed Oct 28, 2009 3:54 pm
by Mark Smith
I could tell you, but then I'd have to kill you
Efficiency, maybe?