diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 16:17:39 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-01-10 16:17:39 -0200 |
commit | 8ddfe3df29dfff3ac9f75972150bd263cc4e3487 (patch) | |
tree | 14d79f1a1653878ef235040935716566acd80c93 /luaconf.h | |
parent | 6eb68ba57a58679cc69837b03490b12ba0cba8d4 (diff) | |
download | lua-8ddfe3df29dfff3ac9f75972150bd263cc4e3487.tar.gz lua-8ddfe3df29dfff3ac9f75972150bd263cc4e3487.tar.bz2 lua-8ddfe3df29dfff3ac9f75972150bd263cc4e3487.zip |
macros for all arithmetic operations over lua_Numbers
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.24 2005/01/07 20:00:33 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.25 2005/01/10 16:31:30 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 | */ |
@@ -247,9 +247,17 @@ __inline int l_lrint (double flt) | |||
247 | #define LUA_UACNUMBER double | 247 | #define LUA_UACNUMBER double |
248 | 248 | ||
249 | 249 | ||
250 | /* primitive `^' operator for numbers */ | 250 | /* primitive operators for numbers */ |
251 | #define num_add(a,b) ((a)+(b)) | ||
252 | #define num_sub(a,b) ((a)-(b)) | ||
253 | #define num_mul(a,b) ((a)*(b)) | ||
254 | #define num_div(a,b) ((a)/(b)) | ||
255 | #define num_unm(a) (-(a)) | ||
256 | #define num_eq(a,b) ((a)==(b)) | ||
257 | #define num_lt(a,b) ((a)<(b)) | ||
258 | #define num_le(a,b) ((a)<=(b)) | ||
251 | #include <math.h> | 259 | #include <math.h> |
252 | #define lua_pow(a,b) pow(a,b) | 260 | #define num_pow(a,b) pow(a,b) |
253 | 261 | ||
254 | 262 | ||
255 | 263 | ||