aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
diff options
context:
space:
mode:
authorPaul Eggert1998-08-29 17:57:22 +0000
committerPaul Eggert1998-08-29 17:57:22 +0000
commite64981da92e01fad3d2299022892105768f0bd4c (patch)
treec6921f4994372e14750b191b274c774ecc52cf8c /src/data.c
parente75ecfecdcaa39d127b448a10cb8c0f374c6923c (diff)
downloademacs-e64981da92e01fad3d2299022892105768f0bd4c.tar.gz
emacs-e64981da92e01fad3d2299022892105768f0bd4c.zip
(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!).
Diffstat (limited to 'src/data.c')
-rw-r--r--src/data.c8
1 files changed, 2 insertions, 6 deletions
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)
2203 { 2203 {
2204 case Aadd: accum += next; break; 2204 case Aadd: accum += next; break;
2205 case Asub: 2205 case Asub:
2206 if (!argnum && nargs != 1) 2206 accum = argnum ? accum - next : nargs == 1 ? - next : next;
2207 next = - next;
2208 accum -= next;
2209 break; 2207 break;
2210 case Amult: accum *= next; break; 2208 case Amult: accum *= next; break;
2211 case Adiv: 2209 case Adiv:
@@ -2265,9 +2263,7 @@ float_arith_driver (accum, argnum, code, nargs, args)
2265 accum += next; 2263 accum += next;
2266 break; 2264 break;
2267 case Asub: 2265 case Asub:
2268 if (!argnum && nargs != 1) 2266 accum = argnum ? accum - next : nargs == 1 ? - next : next;
2269 next = - next;
2270 accum -= next;
2271 break; 2267 break;
2272 case Amult: 2268 case Amult:
2273 accum *= next; 2269 accum *= next;