LuaDardo icon indicating copy to clipboard operation
LuaDardo copied to clipboard

math.random: wrong limits

Open nioate opened this issue 1 year ago • 3 comments

The upper limit in math.random() with 1 or 2 arguments is wrong - it should be increased by 1. (Since the dart random number generator is used, random(1,10) will produce numbers from 1 to 9 while in lua the upper limit is included.)

And also the ls.argCheck(low >= 0, 1, "interval too large"); shouldn't be there - lower limit can be <0.

nioate avatar Jul 24 '23 10:07 nioate