This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/43284] Explicit casting of double to long long causes value to overflow
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2010 10:39:58 -0000
- Subject: [Bug c++/43284] Explicit casting of double to long long causes value to overflow
- References: <bug-43284-18887@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2010-03-08 10:39 -------
(In reply to comment #2)
> Hm? How does calling std::pow with different types behave differently? The
> value can be stored fine if one does "double dValue = std::pow(2.0, 64);long
> long llValue = dValue;" // OK
Integer exponents have an overload that uses an implementation that does
multiple roundings.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43284