This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC 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]

Re: libstdc++/9880: setprecision() strange behaviour


Synopsis: setprecision()  strange behaviour

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Thu Feb 27 17:43:10 2003
State-Changed-Why:
    Not a bug. Note that not every number with a simple
    radix-10 representation can be represented exactly as a 
    finite precision floating point number. If you do
    a floating point assignment, the compiler chooses the closest
    representable floating point number. If you later output
    it with only a small number of digits, the exact value
    of the double gets rounded to what you "expext". If you
    output all digits, you see the true value of the floating
    point representation.
    
    W.
    
    PS: If you find a bug in egcs1.1, gcc2.95 and 3.2, as well
    as Sun CC 6 and 7, there's a good chance it's just your
    misunderstanding, not a bug in so many different compilers...

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9880


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