Commit 4e5b0dca authored by michael's avatar michael

fix -a^b which was interpreted as (-a)^b


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@6713 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 10dc0da7
......@@ -209,19 +209,22 @@ static double evalPrimary(Parser *p){
return d;
}
static double evalPow(Parser *p){
int sign= (*p->s == '+') - (*p->s == '-');
p->s += sign&1;
return (sign|1) * evalPrimary(p);
static double evalPow(Parser *p, int *sign){
*sign= (*p->s == '+') - (*p->s == '-');
p->s += *sign&1;
return evalPrimary(p);
}
static double evalFactor(Parser *p){
double ret= evalPow(p);
int sign, sign2;
double ret, e;
ret= evalPow(p, &sign);
while(p->s[0]=='^'){
p->s++;
ret= pow(ret, evalPow(p));
e= evalPow(p, &sign2);
ret= pow(ret, (sign2|1) * e);
}
return ret;
return (sign|1) * ret;
}
static double evalTerm(Parser *p){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment