Commit e64981da authored by Paul Eggert's avatar Paul Eggert
Browse files

(arith_driver, float_arith_driver): Compute (- x) by

using negation, not subtraction; this makes a difference with
IEEE floating point arithmetic (and also if integer arithmetic
is ones' complement or signed-magnitude!).
parent e75ecfec
...@@ -2203,9 +2203,7 @@ arith_driver (code, nargs, args) ...@@ -2203,9 +2203,7 @@ arith_driver (code, nargs, args)
{ {
case Aadd: accum += next; break; case Aadd: accum += next; break;
case Asub: case Asub:
if (!argnum && nargs != 1) accum = argnum ? accum - next : nargs == 1 ? - next : next;
next = - next;
accum -= next;
break; break;
case Amult: accum *= next; break; case Amult: accum *= next; break;
case Adiv: case Adiv:
...@@ -2265,9 +2263,7 @@ float_arith_driver (accum, argnum, code, nargs, args) ...@@ -2265,9 +2263,7 @@ float_arith_driver (accum, argnum, code, nargs, args)
accum += next; accum += next;
break; break;
case Asub: case Asub:
if (!argnum && nargs != 1) accum = argnum ? accum - next : nargs == 1 ? - next : next;
next = - next;
accum -= next;
break; break;
case Amult: case Amult:
accum *= next; accum *= next;
......
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