This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/22542] ostringstream ignores fenv settings (incorrect output)
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2005 09:46:11 -0000
- Subject: [Bug libstdc++/22542] ostringstream ignores fenv settings (incorrect output)
- References: <20050718084721.22542.stefan.becuwe@ua.ac.be>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2005-07-18 09:46 -------
> Ok, I'll reformulate it and I've even simplified the input. 4.5 is exactly
> representable in double precision, regardless of the active rounding precision.
> It should always be 4.5. What I would like to do is to have that double
> precision input rounded to the number of digits given by .precision (1 in the
> example) using stringstreams, taking into account the rounding mode.
Certainly, the C++ standard doesn't mandate anything about the behavior in the
presence of those settings (among other things, it's C99 material): the behavior
is specified in terms of parameters to an underlying sprintf call. I seem to
understand that you want sprintf itself to take into account the rounding mode
when carrying out its own rounding. I'm not at all sure that the C standard
mandates that (i.e., I'm not at all sure that among the floating point
operations affected there is also the rounding internal to sprintf), but in
case this is a pure libc issue.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22542