diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-09 14:05:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-09 14:05:11 -0300 |
commit | a8aede68c749c554ef5368f31550812f7a9a345a (patch) | |
tree | 8cc99ff1fad328746a3168367f1d57d60a9fbb14 /lvm.c | |
parent | c7859a046ded0eaca74a4412b03fc657d6d9ab4d (diff) | |
download | lua-a8aede68c749c554ef5368f31550812f7a9a345a.tar.gz lua-a8aede68c749c554ef5368f31550812f7a9a345a.tar.bz2 lua-a8aede68c749c554ef5368f31550812f7a9a345a.zip |
new definition for 'luai_nummod' (using 'fmod')
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.193 2014/04/02 16:54:20 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.194 2014/04/08 14:28:04 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -755,7 +755,9 @@ void luaV_execute (lua_State *L) { | |||
755 | setivalue(ra, luaV_mod(L, ib, ic)); | 755 | setivalue(ra, luaV_mod(L, ib, ic)); |
756 | } | 756 | } |
757 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { | 757 | else if (tonumber(rb, &nb) && tonumber(rc, &nc)) { |
758 | setnvalue(ra, luai_nummod(L, nb, nc)); | 758 | lua_Number m; |
759 | luai_nummod(L, nb, nc, m); | ||
760 | setnvalue(ra, m); | ||
759 | } | 761 | } |
760 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); } | 762 | else { Protect(luaT_trybinTM(L, rb, rc, ra, TM_MOD)); } |
761 | ) | 763 | ) |