From 8ddfe3df29dfff3ac9f75972150bd263cc4e3487 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 10 Jan 2005 16:17:39 -0200 Subject: macros for all arithmetic operations over lua_Numbers --- luaconf.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index 2bccf671..64747364 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.24 2005/01/07 20:00:33 roberto Exp roberto $ +** $Id: luaconf.h,v 1.25 2005/01/10 16:31:30 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -247,9 +247,17 @@ __inline int l_lrint (double flt) #define LUA_UACNUMBER double -/* primitive `^' operator for numbers */ +/* primitive operators for numbers */ +#define num_add(a,b) ((a)+(b)) +#define num_sub(a,b) ((a)-(b)) +#define num_mul(a,b) ((a)*(b)) +#define num_div(a,b) ((a)/(b)) +#define num_unm(a) (-(a)) +#define num_eq(a,b) ((a)==(b)) +#define num_lt(a,b) ((a)<(b)) +#define num_le(a,b) ((a)<=(b)) #include -#define lua_pow(a,b) pow(a,b) +#define num_pow(a,b) pow(a,b) -- cgit v1.2.3-55-g6feb