summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 78e823a..401f485 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.94.2.30 2009/08/25 20:59:11 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.94.2.31 2010/02/22 23:19:17 nijtmans Exp $
*/
#include "tclInt.h"
@@ -5374,6 +5374,16 @@ ExprAbsFunc(interp, eePtr, clientData)
d = valuePtr->internalRep.doubleValue;
if (d < 0.0) {
dResult = -d;
+ } else if (d == -0.0) {
+ /* We need to distinguish here between positive 0.0 and
+ * negative -0.0, see Bug ID #2954959.
+ */
+ static const double poszero = 0.0;
+ if (memcmp(&d, &poszero, sizeof(double))) {
+ dResult = -d;
+ } else {
+ dResult = d;
+ }
} else {
dResult = d;
}