This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/43284] Explicit casting of double to long long causes value to overflow



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]