diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-07 16:14:30 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-07 16:14:30 -0300 |
commit | dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5 (patch) | |
tree | 8587dd2e153ee6a3ca56256d30ba2c994e60ecaf /luaconf.h | |
parent | ca7e5b5cb62246653647753f5a6e7fa85e8f030d (diff) | |
download | lua-dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5.tar.gz lua-dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5.tar.bz2 lua-dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5.zip |
macros luai_num* take a state L (when available) as argument, to allow
them to generate errors (and other facilities)
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.82 2006/04/10 18:27:23 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.83 2006/08/04 13:34:37 roberto Exp roberto $ |
3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -529,17 +529,17 @@ | |||
529 | */ | 529 | */ |
530 | #if defined(LUA_CORE) | 530 | #if defined(LUA_CORE) |
531 | #include <math.h> | 531 | #include <math.h> |
532 | #define luai_numadd(a,b) ((a)+(b)) | 532 | #define luai_numadd(L,a,b) ((a)+(b)) |
533 | #define luai_numsub(a,b) ((a)-(b)) | 533 | #define luai_numsub(L,a,b) ((a)-(b)) |
534 | #define luai_nummul(a,b) ((a)*(b)) | 534 | #define luai_nummul(L,a,b) ((a)*(b)) |
535 | #define luai_numdiv(a,b) ((a)/(b)) | 535 | #define luai_numdiv(L,a,b) ((a)/(b)) |
536 | #define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) | 536 | #define luai_nummod(L,a,b) ((a) - floor((a)/(b))*(b)) |
537 | #define luai_numpow(a,b) (pow(a,b)) | 537 | #define luai_numpow(L,a,b) (pow(a,b)) |
538 | #define luai_numunm(a) (-(a)) | 538 | #define luai_numunm(L,a) (-(a)) |
539 | #define luai_numeq(a,b) ((a)==(b)) | 539 | #define luai_numeq(a,b) ((a)==(b)) |
540 | #define luai_numlt(a,b) ((a)<(b)) | 540 | #define luai_numlt(L,a,b) ((a)<(b)) |
541 | #define luai_numle(a,b) ((a)<=(b)) | 541 | #define luai_numle(L,a,b) ((a)<=(b)) |
542 | #define luai_numisnan(a) (!luai_numeq((a), (a))) | 542 | #define luai_numisnan(L,a) (!luai_numeq((a), (a))) |
543 | #endif | 543 | #endif |
544 | 544 | ||
545 | 545 | ||