aboutsummaryrefslogtreecommitdiff
path: root/lmathlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lmathlib.c')
-rw-r--r--lmathlib.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/lmathlib.c b/lmathlib.c
index 21bf9308..33af1d14 100644
--- a/lmathlib.c
+++ b/lmathlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lmathlib.c,v 1.13 1998/12/30 17:22:17 roberto Exp roberto $ 2** $Id: lmathlib.c,v 1.14 1998/12/30 21:23:26 roberto Exp $
3** Lua standard mathematical library 3** Lua standard mathematical library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -12,15 +12,18 @@
12#include "lua.h" 12#include "lua.h"
13#include "lualib.h" 13#include "lualib.h"
14 14
15#ifdef M_PI
16#define PI M_PI
17#else
18#define PI ((double)3.14159265358979323846)
19#endif
20 15
16#define PI (3.14159265358979323846)
21 17
22#define FROMRAD(a) ((a)*(180.0/PI)) 18
23#define TORAD(a) ((a)*(PI/180.0)) 19/*
20** If you want Lua to operate in radians (instead of degrees),
21** changes these two macros to identities:
22** #define FROMRAD(a) (a)
23** #define TORAD(a) (a)
24*/
25#define FROMRAD(a) ((a)*(180.0/PI))
26#define TORAD(a) ((a)*(PI/180.0))
24 27
25 28
26static void math_abs (void) 29static void math_abs (void)