Math.Random behavior still unexpected

Issue #33 resolved
Fabian Maurer created an issue

Math.Random still does not behave as one would expect it to be. I thought I already reported this a long time ago, but it is still present and I didn't see a bugreport, so here it is:

Math.Random does not return a number between "parameter 1" and "parameter 2", but returns a number beween "parameter 1" + "parameter 2":

for i=0, 20 do
    local rnd = Math.Random(10, 20)
    say "rnd $i", "$rnd";
end

Outputs a number beween 10 and 29 (both inclusive).

Comments (3)

  1. Chimaine
    • changed milestone to 3.0.2

    Please leave the milestone empty, since it describes the version where an issue will be fixed in.

  2. Log in to comment