Bug in printf ?

2005-06-30 Thread haro
Hi all, I'm seeing small bug in printf implementation. May be a bug in newlib ?? % uname -a CYGWIN_NT-5.1 wbbrown 1.5.17(0.129/4/2) 2005-05-25 19:38 i686 unknown unknown Cygwin % /bin/printf "%.2f\n" 0.105 0.10 % /bin/printf "%.2f\n" 0.115 0.12

RE: Bug in printf ?

2005-06-30 Thread Dave Korn
Original Message >From: [EMAIL PROTECTED] >Sent: 30 June 2005 11:43 > Hi all, > > I'm seeing small bug in printf implementation. > May be a bug in newlib ?? Confirmed. I'm on it! cheers, DaveK -- Can't think of a witty .sigline today

SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
[EMAIL PROTECTED] wrote: > I'm seeing small bug in printf implementation. What bug? I didn't see anything unexpected. Peter -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http

Re: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
[EMAIL PROTECTED] wrote: > ::How come "0.125" gets printed as "0.12", and not "1.3"? > ^^^ "0.13", off cource ;-) Dealing with integers illustrates the matter more clearly. When the decimal value is exactly 0.5, then printf should round to the n

Re: Bug in printf ?

2005-06-30 Thread Peter Mueller
Hi! Peter J. Acklam wrote: [EMAIL PROTECTED] wrote: ::How come "0.125" gets printed as "0.12", and not "1.3"? ^^^ "0.13", off cource ;-) Dealing with integers illustrates the matter more clearly. When the decimal value is exactly 0

RE: Bug in printf ?

2005-06-30 Thread Dave Korn
Original Message >From: Peter Mueller >Sent: 30 June 2005 13:18 > Hi! > > > Peter J. Acklam wrote: > >> [EMAIL PROTECTED] wrote: ^ Please avoid quoting peoples email addresses in your replies, it causes them to suffer more spamming. > How come "0.125" gets printed

Re: Bug in printf ?

2005-06-30 Thread haro
::Dealing with integers illustrates the matter more clearly. When ::the decimal value is exactly 0.5, then printf should round to the ::nearest *even* integer, as far as I know, so you should get Hi Peter, Thank you for your explanation. I didn't know, until now, that rounding should be done to t

Re: Bug in printf ?

2005-06-30 Thread Yitzchak Scott-Thoennes
On Thu, Jun 30, 2005 at 09:44:57PM +0900, [EMAIL PROTECTED] wrote: > ::Dealing with integers illustrates the matter more clearly. When > ::the decimal value is exactly 0.5, then printf should round to the > ::nearest *even* integer, as far as I know, so you should get > > Hi Peter, > > Thank you

Re: SV: Bug in printf ?

2005-06-30 Thread haro
From: "Peter J. Acklam" Date: Thu, 30 Jun 2005 13:06:51 +0200 (CEST) :: ::> I'm seeing small bug in printf implementation. :: ::What bug? I didn't see anything unexpected. :: ::Peter Hi Peter, How come "0.125" gets printed as "0.12", and not &qu

Re: SV: Bug in printf ?

2005-06-30 Thread haro
OOps, What bug? I didn't see anything unexpected. Peter :: ::Hi Peter, :: ::How come "0.125" gets printed as "0.12", and not "1.3"? ^^^ "0.13", off cource ;-) ::Haro :: -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-

RE: SV: Bug in printf ?

2005-06-30 Thread Dave Korn
Original Message >From: [EMAIL PROTECTED] >Sent: 30 June 2005 12:21 > From: "Peter J. Acklam" > Date: Thu, 30 Jun 2005 13:06:51 +0200 (CEST) >>> >>>> I'm seeing small bug in printf implementation. >>> >>> What b

SV: SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
Dave Korn [EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > > How come "0.125" gets printed as "0.12", and not "1.3"? > > Absolutely, there's a rounding error of some sort. For what it's worth: My Sunblade 100 running Solaris 9 has Solaris' /bin/printf and GNU's printf as /usr/local/bin/pr

RE: SV: Bug in printf ?

2005-06-30 Thread Dave Korn
Original Message >From: Peter J. Acklam >Sent: 30 June 2005 13:13 > Dave Korn [EMAIL PROTECTED] wrote: http://cygwin.com/acronyms#PCYMTNQREAIYR please! TIA! > >> [EMAIL PROTECTED] wrote: >> >>> How come "0.125" gets printed as "0.12", and n

SV: SV: Bug in printf ?

2005-06-30 Thread Peter J. Acklam
Dave Korn wrote: > Have you considered that your sunblade might be operating > in a different rounding mode, by default? I didn't know there were different rounding modes. I thought everyone used so-called "unbiased rounding", so I'm sorry for adding confusion. > I would imagine that printf may

Re: SV: Bug in printf ?

2005-06-30 Thread Brian Dessent
Dave Korn wrote: > Absolutely, there's a rounding error of some sort. Compare the difference > when compiling the testcase with -mno-cygwin (i.e. using mingw maths lib): Isn't this just a case of the Cygwin math library choosing "round to even" and the MSVCRT/mingw library choosing "0.5 always

RE: SV: Bug in printf ?

2005-06-30 Thread Dave Korn
Original Message >From: Brian Dessent >Sent: 30 June 2005 16:58 > Dave Korn wrote: > >> Absolutely, there's a rounding error of some sort. Compare the >> difference when compiling the testcase with -mno-cygwin (i.e. using >> mingw maths lib): > > Isn't this just a case of the Cygwin

RE: SV: Bug in printf ?

2005-07-05 Thread Dave Korn
Original Message >From: Peter J. Acklam >Sent: 30 June 2005 13:13 > Dave Korn [EMAIL PROTECTED] wrote: > >> [EMAIL PROTECTED] wrote: ^^ Peter, please do http://cygwin.com/acronyms#PCYMTNQREAIYR before you get me

Re: SV: Bug in printf ?

2005-07-06 Thread Lev Bishop
I don't think there is any bug here. This is what I've seen from a little digging: 1) cygwin strtod rounds to even, with about DECIMAL_DIG (==21) digits precision, as recommended by 7.20.1.3 of WG14/N843. (It acts strange when the rounding mode is not round to nearest, but since newlib doesn't pro

Re: SV: Bug in printf ?

2005-07-06 Thread Lev Bishop
On 06/07/05, Lev Bishop wrote: > 4) I have no idea what mingw is doing, but it's different to the > above. Gcc constructs the same double precision constants as on cygwin > but strtod() is different and seems to have less precision, and > printf() seems to work with about 16 digits precision. At a

RE: SV: Bug in printf ?

2005-07-06 Thread Dave Korn
Original Message >From: Lev Bishop >Sent: 06 July 2005 09:15 > On 06/07/05, Lev Bishop wrote: >> 4) I have no idea what mingw is doing, but it's different to the >> above. Gcc constructs the same double precision constants as on cygwin >> but strtod() is different and seems to have less pr

Re: [1.7] bug in printf and %ls

2009-05-15 Thread Alexey Borzenkov
built-in user and group names (like Administrator, Domain Users, etc.) > are localized. With cygwin 1.5 these names were successfully exported > by mkpasswd/mkgroup, however with cygwin 1.7 all such usernames are > silently ignored and don't appear in the output. And I found why. I

Re: [1.7] bug in printf and %ls

2009-05-15 Thread Alexey Borzenkov
On Fri, May 15, 2009 at 1:30 PM, Alexey Borzenkov wrote: > And I found why. It appears that there's a bug in printf with %ls that > will refuse to print the string completely if the wide string for %ls > cannot be represented in current charset. [...] > Prints nothing, i.e.

Re: [1.7] bug in printf and %ls

2009-05-15 Thread Corinna Vinschen
On May 15 13:30, Alexey Borzenkov wrote: > [...] > It appears that there's a bug in printf with %ls that > will refuse to print the string completely if the wide string for %ls > cannot be represented in current charset. It's interesting that > sometimes it behaves

Re: [1.7] bug in printf and %ls

2009-05-15 Thread Corinna Vinschen
On May 15 13:49, Alexey Borzenkov wrote: > On Fri, May 15, 2009 at 1:30 PM, Alexey Borzenkov wrote: > > And I found why. It appears that there's a bug in printf with %ls that > > will refuse to print the string completely if the wide string for %ls > > cannot be repr