[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-19 Thread s.cecilio at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #8 from Cecilio 2011-05-19 17:01:15 UTC --- Thanks again, Paolo and Jackub, for your help and explanations. Believe it or not, I a have a PhD and had to learn a lot of complex mathematics, but I never heard about so many types of 'rou

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-19 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #7 from Paolo Carlini 2011-05-19 08:42:45 UTC --- Glad that the issue is clear now. By the way, Cecilio, apparently in your Comment #4 you didn't get my point about the C++ library vs printf: the ISO C++ Standard specifies the behavio

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-19 Thread s.cecilio at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #6 from Cecilio 2011-05-19 07:12:25 UTC --- Thanks for the link. Funny website but a great article at wikipedia. Thanks indeed. Now I understand the issue, so there is no bug anywere! I always understood 'rounding' as 'rounding up'.

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5 f

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-18 Thread s.cecilio at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #4 from Cecilio 2011-05-19 05:39:43 UTC --- Ok Thank you, I will report to glbc. But, to try to learn and understand something, could you please answer a question for me?: My understanding is that printf truncates, so 'printf("%.2f"

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-18 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #3 from Paolo Carlini 2011-05-18 20:47:19 UTC --- In the ISO C++ Standard which we are implementing, the semantics of setprecision and numeric output in general, is specified in terms of printf behavior. In this specific implementatio

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-18 Thread s.cecilio at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 --- Comment #2 from Cecilio 2011-05-18 20:23:23 UTC --- printf output is 5798.12. I think this is the expected output. Does this confirms your guess? (sorry, I don't understand your previous answer. My knowledge about GCC is just the name "GCC".

[Bug libstdc++/49048] setprecision rounding fails in some cases

2011-05-18 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49048 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|