mercredi 6 mai 2015

Lua math.random returns erratic values

I was wondering why I had invalid data for a script, then I tried to test math.random since it seemed to be coming from it's return values. This is what I got from the Lua console :

> return  math.random(0.8, 1.2);
0.8
> return  math.random(0.8, 1.2);
0.8
> return  math.random(0.8, 1.2);
0.8
> return  math.random(0.8, 1.2);
1.8
> return  math.random(0.8, 1.2);
0.8
> return  math.random(0.8, 1.2);
1.8
> return  math.random(0.8, 1.2);
0.8
> return  math.random(0.8, 1.2);
1.8
> return  math.random(0.8, 1.2);
0.8

I am a little confused about the results I'm getting. Someone can clarify?




Aucun commentaire:

Enregistrer un commentaire