lua-users home
lua-l archive

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

On 10/09/2013, at 1:10 PM, Michael Horvath <> wrote:

> I don't think it worked. I got the following output:
> wutwut =0.1883697509765625
> wutwut =0
> wutwut =0.1883697509765625

Check what you typed.  It worked for me (after I added local mod = math.mod):

lua test2.lua 
wutwut =0.18836975097656
wutwut =0.087860107421875
wutwut =0.15574645996094

By the way, what's wrong with math.random?  The RNG you've implemented isn't a particularly good one, so why not stick with the default (which is very good in LuaJIT)