new definition for 'luai_nummod' (using 'fmod')

This commit is contained in:
Roberto Ierusalimschy
2014-04-09 14:05:11 -03:00
parent c7859a046d
commit a8aede68c7
3 changed files with 13 additions and 6 deletions

6
lvm.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.193 2014/04/02 16:54:20 roberto Exp roberto $
** $Id: lvm.c,v 2.194 2014/04/08 14:28:04 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -755,7 +755,9 @@ void luaV_execute (lua_State *L) {
setivalue(ra, luaV_mod(L, ib, ic));
}
else if (tonumber(rb, &nb) && tonumber(rc, &nc)) {
setnvalue(ra, luai_nummod(L, nb, nc));
lua_Number m;
luai_nummod(L, nb, nc, m);
setnvalue(ra, m);
}
else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); }
)