new operation '//' (integer division)

This commit is contained in:
Roberto Ierusalimschy
2013-04-26 10:08:29 -03:00
parent a80a2b5e56
commit a2f5c28a80
14 changed files with 56 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: luaconf.h,v 1.176 2013/03/16 21:10:18 roberto Exp roberto $
** $Id: luaconf.h,v 1.177 2013/04/25 13:52:13 roberto Exp roberto $
** Configuration file for Lua
** See Copyright Notice in lua.h
*/
@@ -435,6 +435,7 @@
/* the following operations need the math library */
#if defined(lobject_c) || defined(lvm_c)
#include <math.h>
#define luai_numidiv(L,a,b) (l_mathop(floor)((a)/(b)))
#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b))
#define luai_numpow(L,a,b) (l_mathop(pow)(a,b))
#endif