Subject: Re: floating point negative zero in awk
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 08/29/2007 11:40:59
>> Of the tools supplied with NetBSD that are capable of performing
>> arbitrary arithmetic, awk seems to be the only one that prints
>> negative zero as the result from simple calculations:
>> [sh $(()), expr, bc, dc, awk]
> [similar results from a sun4u with SunOS 5.8, and HP-UX]

Of these, sh $(()) and expr do integer arithmetic only, so they don't
need even be considered when worrying about floating-point hardware
things like negative zero.  I'm not sure about bc and dc, but I think
they do their own floating-point by working with strings of digits,
rather than using the hardware's floating-point support, in which case
this is relevant to their implementation of zero but not to hardware

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B