From: Paul Eggert Date: Sat, 29 Aug 1998 17:57:22 +0000 (+0000) Subject: (arith_driver, float_arith_driver): Compute (- x) by X-Git-Tag: emacs-20.4~1801 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e64981da92e01fad3d2299022892105768f0bd4c;p=emacs.git (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!). --- diff --git a/src/data.c b/src/data.c index 9d3955dd3a9..cb04426edf6 100644 --- a/src/data.c +++ b/src/data.c @@ -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;