lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 8b45d9806aec534d7b0b788da887c4b421c5395d
parent be52f784d90a4a84a45a8c8474d2a8989b64f3a3
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu,  3 Apr 2014 11:17:54 -0300

new constants 'math.maxint'/'math.minint'

Diffstat:
Mlmathlib.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lmathlib.c b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.93 2014/03/31 19:00:52 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.94 2014/04/01 14:39:55 roberto Exp roberto $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -316,6 +316,10 @@ LUAMOD_API int luaopen_math (lua_State *L) { lua_setfield(L, -2, "pi"); lua_pushnumber(L, HUGE_VAL); lua_setfield(L, -2, "huge"); + lua_pushinteger(L, LUA_MAXINTEGER); + lua_setfield(L, -2, "maxint"); + lua_pushinteger(L, LUA_MININTEGER); + lua_setfield(L, -2, "minint"); return 1; }