summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/luaconf.h
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-07-27 16:06:51 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-07-27 16:06:51 +0000
commit527b069653bf06661b8a9650e1f5eb2c6e7cc2bf (patch)
tree14e5bf14908825218f31ddc713be99be2b2be7e3 /apps/plugins/lua/luaconf.h
parent74d4d0db0c667887476e825fde274120591ff6e7 (diff)
downloadrockbox-527b069653bf06661b8a9650e1f5eb2c6e7cc2bf.zip
rockbox-527b069653bf06661b8a9650e1f5eb2c6e7cc2bf.tar.gz
rockbox-527b069653bf06661b8a9650e1f5eb2c6e7cc2bf.tar.bz2
rockbox-527b069653bf06661b8a9650e1f5eb2c6e7cc2bf.tar.xz
Lua: implement the ^ and % operators
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22070 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lua/luaconf.h')
-rw-r--r--apps/plugins/lua/luaconf.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/lua/luaconf.h b/apps/plugins/lua/luaconf.h
index 478ea14..109e680 100644
--- a/apps/plugins/lua/luaconf.h
+++ b/apps/plugins/lua/luaconf.h
@@ -529,13 +529,13 @@
@@ The luai_num* macros define the primitive operations over numbers.
*/
#if defined(LUA_CORE)
-#include <math.h>
+extern long rb_pow(long, long);
#define luai_numadd(a,b) ((a)+(b))
#define luai_numsub(a,b) ((a)-(b))
#define luai_nummul(a,b) ((a)*(b))
#define luai_numdiv(a,b) ((a)/(b))
-#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b))
-#define luai_numpow(a,b) (pow(a,b))
+#define luai_nummod(a,b) ((a)%(b))
+#define luai_numpow(a,b) (rb_pow(a,b))
#define luai_numunm(a) (-(a))
#define luai_numeq(a,b) ((a)==(b))
#define luai_numlt(a,b) ((a)<(b))