From 3e6d23bb9d57ae3d19e9eb47ced654669fca4d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Aulery?= Date: Sun, 7 Jul 2013 02:02:46 +0200 Subject: Use the new M_E symbol from math.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the new M_E symbol from math.h and fix and a value of the same accuracy if it's necessary to redefine M_E. Signed-off-by: Stéphane Aulery Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith --- math.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/math.c b/math.c index bb31b14..63e24b2 100644 --- a/math.c +++ b/math.c @@ -21,7 +21,11 @@ #ifndef M_PI /* sometimes defined in math.h */ #define M_PI 3.14159265358979323846 #endif -#define E 2.71828182845904 + +#ifndef M_E /* sometimes defined in math.h */ +#define M_E 2.7182818284590452354 +#endif + #define MAXDISP 11 #define DEG 0 /* DRG mode. used for trig calculations */ #define RAD 1 @@ -688,7 +692,7 @@ oneop(int keynum) entered = 2; switch (keynum) { /* do the actual math fn. */ - case kE: if (rpn && memop != kENTR) PushNum(dnum); dnum=E; break; + case kE: if (rpn && memop != kENTR) PushNum(dnum); dnum=M_E; break; case kPI: if (rpn && memop != kENTR) PushNum(dnum); dnum=M_PI; break; case kRECIP: dnum=1.0/dnum; break; case kSQR: flagINV = !flagINV; /* fall through to */ -- cgit v1.2.3