public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/9880: setprecision()  strange behaviour
@ 2003-02-27 17:43 bangerth
  0 siblings, 0 replies; only message in thread
From: bangerth @ 2003-02-27 17:43 UTC (permalink / raw)
  To: Alberto.Ribon, gcc-bugs, gcc-prs, nobody

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-27 17:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-27 17:43 libstdc++/9880: setprecision() strange behaviour bangerth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).