From 8e36e1fe4928c60a09573a850e6807d922a56664 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Mar 2007 09:37:00 -0300 Subject: details (randomseed calls rand once to dischard first value) --- lmathlib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lmathlib.c b/lmathlib.c index 23b245e6..3d920715 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.67 2005/08/26 17:36:32 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.68 2006/08/07 19:01:56 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -211,6 +211,7 @@ static int math_random (lua_State *L) { static int math_randomseed (lua_State *L) { srand(luaL_checkint(L, 1)); + (void)rand(); /* discard first value to avoid undesirable correlations */ return 0; } -- cgit v1.2.3-55-g6feb