This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64497] std::scalbln does not round correctly for long doubles
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Jan 2015 14:07:25 +0000
- Subject: [Bug c++/64497] std::scalbln does not round correctly for long doubles
- Auto-submitted: auto-generated
- References: <bug-64497-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64497
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Walter Mascarenhas from comment #2)
> What if there is a difference in the expected behavior
> for this function in C and C++11?
There isn't any difference, so it doesn't matter.
> Is it not up to g++
> for implementing what is mandated in C++11? (This
> is not a rhetorical question, I really do not know the answer.)
Yes.
> On the other hand,
> http://en.cppreference.com/w/cpp/numeric/math/scalbn states that
>
> "If a range error due to underflow occurs, the correct result (after
> rounding) is returned."
The C++ standard doesn't say that.
> I looked at the standard (N3797.pdf) but did not find anything
> specific about std::scalbln.
It says it is the same as C, so cppreference.com is wrong.