forked from len0rd/rockbox
Lua: implement the ^ and % operators
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22070 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
74d4d0db0c
commit
527b069653
2 changed files with 33 additions and 22 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue