aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Celes <celes@tecgraf.puc-rio.br>1994-07-20 19:12:27 -0300
committerWaldemar Celes <celes@tecgraf.puc-rio.br>1994-07-20 19:12:27 -0300
commite9e9cb03f0c8792cab3759deb9a66b21f6678d3d (patch)
tree4f6b975737c6ee083d6d68d232efb212c2dc4818
parent0eb6ee3feec634134b823f300652075c218d16c1 (diff)
downloadlua-e9e9cb03f0c8792cab3759deb9a66b21f6678d3d.tar.gz
lua-e9e9cb03f0c8792cab3759deb9a66b21f6678d3d.tar.bz2
lua-e9e9cb03f0c8792cab3759deb9a66b21f6678d3d.zip
Aumentar precisao do valor de PI.
-rw-r--r--mathlib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mathlib.c b/mathlib.c
index d16eb596..eb148790 100644
--- a/mathlib.c
+++ b/mathlib.c
@@ -3,15 +3,17 @@
3** Mathematics library to LUA 3** Mathematics library to LUA
4*/ 4*/
5 5
6char *rcs_mathlib="$Id: $"; 6char *rcs_mathlib="$Id: mathlib.c,v 1.1 1993/12/17 18:41:19 celes Exp celes $";
7 7
8#include <stdio.h> /* NULL */ 8#include <stdio.h> /* NULL */
9#include <math.h> 9#include <math.h>
10 10
11#include "lualib.h"
11#include "lua.h" 12#include "lua.h"
12 13
13#define TODEGREE(a) ((a)*180.0/3.14159) 14#define PI (3.141592653589793)
14#define TORAD(a) ((a)*3.14159/180.0) 15#define TODEGREE(a) ((a)*180.0/PI)
16#define TORAD(a) ((a)*PI/180.0)
15 17
16static void math_abs (void) 18static void math_abs (void)
17{ 19{