mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-24 10:38:38 +00:00
(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!).
This commit is contained in:
parent
e75ecfecdc
commit
e64981da92
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user