summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorStéphane Aulery <lkppo@free.fr>2013-07-07 02:02:46 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-07-06 20:42:10 -0700
commit3e6d23bb9d57ae3d19e9eb47ced654669fca4d7c (patch)
tree951ea1b0cb1da722b19b0a8758c13ff5b21adf2c /math.c
parentf3b065f03a7b68310b489d5d97b11985ef36e977 (diff)
Use the new M_E symbol from math.h
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 <lkppo@free.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'math.c')
-rw-r--r--math.c8
1 files 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 */