lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>   It may just be a fault with the documentation, but random() doesn't work
> as described under certain circumstances.

It is really a bug, and the cause is what you pointed out. Thank you. It 
will be corrected in next version. 

The call "random(0)" is also buggy, but it should not return 0 as you 
sugested; random(1,n) must return an integer between 1 and n; if n is 0, 
there is no such a number, so "random(0)" should give an error (as 
"random(3,2)" already does). "random(0)" is the same as "random(1,0)", but 
"random(1,0)" is also buggy, so it doesn't help to compare them ;-) 

-- Roberto