[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/modules/m4.c,v
From: |
Eric Blake |
Subject: |
Changes to m4/modules/m4.c,v |
Date: |
Tue, 03 Apr 2007 21:06:17 +0000 |
CVSROOT: /sources/m4
Module name: m4
Changes by: Eric Blake <ericb> 07/04/03 21:06:16
Index: modules/m4.c
===================================================================
RCS file: /sources/m4/m4/modules/m4.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -b -r1.105 -r1.106
--- modules/m4.c 2 Apr 2007 12:06:23 -0000 1.105
+++ modules/m4.c 3 Apr 2007 21:06:16 -0000 1.106
@@ -1095,9 +1095,13 @@
#define numb_negate(x) ((x) = (- (x)))
#define numb_times(x, y) ((x) = ((x) * (y)))
-#define numb_ratio(x, y) ((x) = ((x) / ((y))))
-#define numb_divide(x, y) (*(x) = (*(x) / (*(y))))
-#define numb_modulo(c, x, y) (*(x) = (*(x) % *(y)))
+/* Be careful of x86 SIGFPE. */
+#define numb_ratio(x, y) \
+ (((y) == -1) ? (numb_negate (x)) : ((x) /= (y)))
+#define numb_divide(x, y) \
+ ((*(y) == -1) ? (numb_negate (*(y))) : (*(x) /= *(y)))
+#define numb_modulo(c, x, y) \
+ ((*(y) == -1) ? (*(x) = numb_ZERO) : (*(x) %= *(y)))
/* numb_invert is only used in the context of x**-y, which integral math
does not support. */
#define numb_invert(x) return NEGATIVE_EXPONENT