diff src/data.c @ 23148:10e261360159

(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!).
author Paul Eggert <eggert@twinsun.com>
date Sat, 29 Aug 1998 17:57:22 +0000
parents 1d223a4bf4de
children ec2d671b77ba
line wrap: on
line diff
--- a/src/data.c	Sat Aug 29 17:11:50 1998 +0000
+++ b/src/data.c	Sat Aug 29 17:57:22 1998 +0000
@@ -2203,9 +2203,7 @@
 	{
 	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 @@
 	  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;