From 827846804196b1779a61ffdc75d0aeb157f8465d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 4 Jan 1999 10:41:12 -0200 Subject: comments --- lmathlib.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'lmathlib.c') diff --git a/lmathlib.c b/lmathlib.c index 21bf9308..33af1d14 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -1,5 +1,5 @@ /* -** $Id: lmathlib.c,v 1.13 1998/12/30 17:22:17 roberto Exp roberto $ +** $Id: lmathlib.c,v 1.14 1998/12/30 21:23:26 roberto Exp $ ** Lua standard mathematical library ** See Copyright Notice in lua.h */ @@ -12,15 +12,18 @@ #include "lua.h" #include "lualib.h" -#ifdef M_PI -#define PI M_PI -#else -#define PI ((double)3.14159265358979323846) -#endif +#define PI (3.14159265358979323846) -#define FROMRAD(a) ((a)*(180.0/PI)) -#define TORAD(a) ((a)*(PI/180.0)) + +/* +** If you want Lua to operate in radians (instead of degrees), +** changes these two macros to identities: +** #define FROMRAD(a) (a) +** #define TORAD(a) (a) +*/ +#define FROMRAD(a) ((a)*(180.0/PI)) +#define TORAD(a) ((a)*(PI/180.0)) static void math_abs (void) -- cgit v1.2.3-55-g6feb