diff options
author | Emil Renner Berthing <esmil@mailme.dk> | 2012-07-15 01:06:01 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2012-07-23 17:36:24 +0200 |
commit | 78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe (patch) | |
tree | d9e476dfee06bf8ba6dcf4499fb78ce1350728fe /lua/lmathlib.c | |
parent | 3a1c6f4e205c8c6d28abc641e568f2fa6362c654 (diff) | |
download | lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.gz lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.tar.xz lem-78e6e89431e4ef9419a716f246f1f3cfaf7d9dfe.zip |
Lua 5.2.1
Diffstat (limited to 'lua/lmathlib.c')
-rw-r--r-- | lua/lmathlib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/lmathlib.c b/lua/lmathlib.c index b17237f..c3c605e 100644 --- a/lua/lmathlib.c +++ b/lua/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.80 2011/07/05 12:49:35 roberto Exp $ +** $Id: lmathlib.c,v 1.81 2012/05/18 17:47:53 roberto Exp $ ** Standard mathematical library ** See Copyright Notice in lua.h */ @@ -17,17 +17,17 @@ #include "lualib.h" -#undef PI -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - - /* macro 'l_tg' allows the addition of an 'l' or 'f' to all math operations */ #if !defined(l_tg) #define l_tg(x) (x) #endif +#undef PI +#define PI (l_tg(3.1415926535897932384626433832795)) +#define RADIANS_PER_DEGREE (PI/180.0) + + static int math_abs (lua_State *L) { lua_pushnumber(L, l_tg(fabs)(luaL_checknumber(L, 1))); |