This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

SV: SV: Bug in printf ?


Dave Korn [dave.korn@artimi.com] wrote:

> haro@kgt.co.jp 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/printf
and both give "0.12", not "0.13".

I am quite sure it is the printf returning "0.13" that is buggy.
Note that the value "0.125" can be represented exactly with IEEE
double precision arithmetic, so inexact representation is not the
matter here.

Peter

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]