[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: PRNG for Lua 4.0?
- From: Geoff Leyland <geoff_leyland@...>
- Date: Tue, 10 Sep 2013 13:31:12 +1200
On 10/09/2013, at 1:10 PM, Michael Horvath <mikh2161@gmail.com> 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)