Xref: utzoo unix-pc.general:7089 comp.sys.att:11386 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bywater!scifi!hybrid!chance!john From: john@chance.UUCP (John R. MacMillan) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: 3B1 C runtime library bug; do you have it too? Message-ID: <1991Jan5.152216.18838@chance.UUCP> Date: 5 Jan 91 15:22:16 GMT References: <37567@cup.portal.com> Organization: Haphazard Lines: 33 |All 3B1 systems I have here (with 3.5 & 3.5 dev. set and 3.51m w/3.51 dev set) |produce the (incorrect) results: | | *.*f | 1.230 I'm not convinced these are incorrect results... |main() |{ | int p = 3; | double frac = 1.23; | | printf ("%0*.*f\n", p+3, p, frac); ^ | printf ("%*.*f\n", p+3, p, frac); |} The printf(3) man page says the spec is "...the character %...zero or more flags...an optional decimal digit specifying minimum field width...a period followed by a decimal digit", and "a field width or precision may be indicated by an asterisk instead of a digit string" Now the '0' after the '%' above is not one of the listed flag chars, but the '*' is only acceptable *instead of* a field width. So I'd say that by the 3.51 man page I have, the specification is illegal. Am I missing something? -- John R. MacMillan | I wish I had a nickname like Crusher, Snake or Dennis john@chance.UUCP | Because guys with nicknames always get the gal. ...!scocan!chance!john | -- barenaked ladies