aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h
diff options
context:
space:
mode:
Diffstat (limited to 'luaconf.h')
-rw-r--r--luaconf.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/luaconf.h b/luaconf.h
index d6a5e664..a7a16f6a 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: luaconf.h,v 1.181 2013/05/26 13:35:52 roberto Exp roberto $ 2** $Id: luaconf.h,v 1.182 2013/06/13 19:35:08 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*/
@@ -423,6 +423,7 @@
423#define LUA_NUMBER_FMT "%.7g" 423#define LUA_NUMBER_FMT "%.7g"
424 424
425#define l_mathop(op) op##f 425#define l_mathop(op) op##f
426#define l_floor(x) (floorf(x))
426 427
427#define lua_str2number(s,p) strtof((s), (p)) 428#define lua_str2number(s,p) strtof((s), (p))
428 429
@@ -438,6 +439,7 @@
438#define LUA_NUMBER_FMT "%.14g" 439#define LUA_NUMBER_FMT "%.14g"
439 440
440#define l_mathop(op) op 441#define l_mathop(op) op
442#define l_floor(x) (floor(x))
441 443
442#define lua_str2number(s,p) strtod((s), (p)) 444#define lua_str2number(s,p) strtod((s), (p))
443 445
@@ -452,7 +454,6 @@
452#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) 454#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n))
453 455
454 456
455
456/* 457/*
457@@ The luai_num* macros define the primitive operations over numbers. 458@@ The luai_num* macros define the primitive operations over numbers.
458@* They should work for any size of floating numbers. 459@* They should work for any size of floating numbers.
@@ -461,7 +462,7 @@
461/* the following operations need the math library */ 462/* the following operations need the math library */
462#if defined(lobject_c) || defined(lvm_c) 463#if defined(lobject_c) || defined(lvm_c)
463#include <math.h> 464#include <math.h>
464#define luai_nummod(L,a,b) ((a) - l_mathop(floor)((a)/(b))*(b)) 465#define luai_nummod(L,a,b) ((a) - l_floor((a)/(b))*(b))
465#define luai_numpow(L,a,b) (l_mathop(pow)(a,b)) 466#define luai_numpow(L,a,b) (l_mathop(pow)(a,b))
466#endif 467#endif
467 468