[PATCH xcalc 2/2] Use the new M_E symbol from math.h
Stéphane Aulery
lkppo at free.fr
Sat Jul 6 17:02:46 PDT 2013
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 at free.fr>
---
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 */
--
1.7.10.4
More information about the xorg-devel
mailing list