File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- ** $Id: lmathlib.c,v 1.106 2014/07/16 13:47:13 roberto Exp roberto $
2+ ** $Id: lmathlib.c,v 1.107 2014/07/17 12:30:53 roberto Exp roberto $
33** Standard mathematical library
44** See Copyright Notice in lua.h
55*/
@@ -164,6 +164,14 @@ static int math_sqrt (lua_State *L) {
164164 return 1 ;
165165}
166166
167+
168+ static int math_ult (lua_State * L ) {
169+ lua_Integer a = luaL_checkinteger (L , 1 );
170+ lua_Integer b = luaL_checkinteger (L , 2 );
171+ lua_pushboolean (L , (lua_Unsigned )a < (lua_Unsigned )b );
172+ return 1 ;
173+ }
174+
167175static int math_log (lua_State * L ) {
168176 lua_Number x = luaL_checknumber (L , 1 );
169177 lua_Number res ;
@@ -343,6 +351,7 @@ static const luaL_Reg mathlib[] = {
343351 {"tointeger" , math_toint },
344352 {"floor" , math_floor },
345353 {"fmod" , math_fmod },
354+ {"ult" , math_ult },
346355 {"log" , math_log },
347356 {"max" , math_max },
348357 {"min" , math_min },
You can’t perform that action at this time.
0 commit comments