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)
{
case Aadd: accum += next; break;
case Asub:
if (!argnum && nargs != 1)
next = - next;
accum -= next;
accum = argnum ? accum - next : nargs == 1 ? - next : next;
break;
case Amult: accum *= next; break;
case Adiv:
......@@ -2265,9 +2263,7 @@ float_arith_driver (accum, argnum, code, nargs, args)
accum += next;
break;
case Asub:
if (!argnum && nargs != 1)
next = - next;
accum -= next;
accum = argnum ? accum - next : nargs == 1 ? - next : next;
break;
case Amult:
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