From 453450d68751f74f0fab44bd96725a5606d2d9a1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 20 Jun 2013 12:02:49 -0300 Subject: new macro 'l_floor' (allows 'floorf' even when other math operations do not have an 'f' variant) --- luaconf.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index d6a5e664..a7a16f6a 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.181 2013/05/26 13:35:52 roberto Exp roberto $ +** $Id: luaconf.h,v 1.182 2013/06/13 19:35:08 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -423,6 +423,7 @@ #define LUA_NUMBER_FMT "%.7g" #define l_mathop(op) op##f +#define l_floor(x) (floorf(x)) #define lua_str2number(s,p) strtof((s), (p)) @@ -438,6 +439,7 @@ #define LUA_NUMBER_FMT "%.14g" #define l_mathop(op) op +#define l_floor(x) (floor(x)) #define lua_str2number(s,p) strtod((s), (p)) @@ -452,7 +454,6 @@ #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) - /* @@ The luai_num* macros define the primitive operations over numbers. @* They should work for any size of floating numbers. @@ -461,7 +462,7 @@ /* the following operations need the math library */ #if defined(lobject_c) || defined(lvm_c) #include -#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b)) +#define luai_nummod(L,a,b) ((a) - l_floor((a)/(b))*(b)) #define luai_numpow(L,a,b) (l_mathop(pow)(a,b)) #endif -- cgit v1.2.3-55-g6feb