19 |
|
|
20 |
|
#include "copyright.h" |
21 |
|
|
22 |
– |
#include <stdio.h> |
23 |
– |
#include <string.h> |
22 |
|
#include <ctype.h> |
23 |
|
#include <errno.h> |
24 |
|
#include <math.h> |
103 |
|
char *expr |
104 |
|
) |
105 |
|
{ |
106 |
+ |
int prev_support = esupport; |
107 |
|
EPNODE *ep; |
108 |
|
double rval; |
109 |
|
|
110 |
+ |
esupport &= ~E_RCONST; /* don't bother reducing constant expr */ |
111 |
|
ep = eparse(expr); |
112 |
+ |
esupport = prev_support; /* as you were */ |
113 |
|
rval = evalue(ep); |
114 |
|
epfree(ep); |
115 |
|
return(rval); |
674 |
|
ep2 = newnode(); |
675 |
|
ep2->type = NUM; |
676 |
|
ep2->v.num = 1; |
677 |
+ |
} else if (ep3->type == NUM && ep3->v.num == 1) { |
678 |
+ |
efree((char *)ep3); /* (E4 ^ 1) */ |
679 |
+ |
ep1->sibling = NULL; |
680 |
+ |
efree((char *)ep2); |
681 |
+ |
ep2 = ep1; |
682 |
|
} |
683 |
|
} |
684 |
|
return(ep2); |