summaryrefslogtreecommitdiff
path: root/tran.c
diff options
context:
space:
mode:
Diffstat (limited to 'tran.c')
-rw-r--r--tran.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tran.c b/tran.c
index e9d77506a34d9..a9fa3259f4379 100644
--- a/tran.c
+++ b/tran.c
@@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) /* set float val of a Cell */
xfree(vp->sval); /* free any previous string */
vp->tval &= ~STR; /* mark string invalid */
vp->tval |= NUM; /* mark number ok */
+ if (f == -0) /* who would have thought this possible? */
+ f = 0;
dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) );
return vp->fval = f;
}