Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!caen!ox.com!ox.com!osm From: osm@ox.com (Owen Scott Medd) Newsgroups: comp.unix.ultrix Subject: Re: Actually it's printf.. (was Re: Another C compiler bug) Message-ID: <1990Nov13.005753.3382@ox.com> Date: 13 Nov 90 00:57:53 GMT References: <22443@dime.cs.umass.edu> Sender: usenet@ox.com (Usenet News Administrator) Reply-To: osm@ox.com (Owen Scott Medd) Organization: OTA Limited Partnership -- Ann Arbor Lines: 20 In many articles people complain about rounding errors with the Ultrix C compiler... > [ ad nauseum... ] The problem is rounding up when there is a zero in the last displayed digit. That is: printf("%6.2f\n", .006) prints 0.00, while printf("%6.2f\n", .016) prints 0.02 The internal representation is correct, just printf/*cvt are screwed up. This is a *documented* bug in the Ultrix 4.0 (cc2.0) C compiler (right there in the release notes) and an undocumented bug in the cc1.31 compiler. The Atlanta CSC *assures* me that it's fixed in the 4.1 cc, though they have not followed through on their request (of a week ago!) of getting me a rush copy of 4.1. Sigh.