> From: j...@wxcvbn.org (=?utf-8?Q?J=C3=A9r=C3=A9mie_Courr=C3=A8ges-Anglas?=) > Date: Sun, 14 Jul 2013 09:41:28 +0200 > > > This diff updates awk to the 20121220 upstream version, with a few > fixups. > > ok? > > Index: tran.c > =================================================================== > RCS file: /cvs/src/usr.bin/awk/tran.c,v > retrieving revision 1.15 > diff -u -p -r1.15 tran.c > --- tran.c 28 Sep 2011 19:27:18 -0000 1.15 > +++ tran.c 22 Jun 2013 21:47:01 -0000 > @@ -299,6 +299,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / > 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;
This is a bit silly. Even though floating point values may be able to repesent signed zeroes (the IEEE standard formats do) they are guaranteed to compare equal to the zero with the opposite sign. This diff forces all zeroes to be positive zeroes. Not sure that is desirable. GNU awk seems to treat them differently. See <http://www.gnu.org/software/gawk/manual/html_node/Unexpected-Results.html#Unexpected-Results> Cheers, Mark