Boost.Math pow and __int64

Hello all, Not sure if this zero warning policy is in effect, but if so maybe Boost can have a look at use of __int64 and pow (e.g. boost::math::pow<2, __int64> gives a warning)?

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of gast128 Sent: Monday, September 27, 2010 9:36 AM To: boost-users@lists.boost.org Subject: [Boost-users] Boost.Math pow and __int64
Hi
Not sure if this zero warning policy is in effect, but if so maybe Boost can have a look at use of __int64 and pow (e.g. boost::math::pow<2, __int64> gives a warning)?
Please can you be more specific about your use, and the full warning you get. My impression at a glance is that the warning may be telling about the *potential* for overflow, and it may be difficult to tell at compile time if this actually happens? (You might need to suppress this warning, if you are sure it doesn't apply to your use?) Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com

Not sure if this zero warning policy is in effect, but if so maybe Boost can have a look at use of __int64 and pow (e.g. boost::math::pow<2, __int64> gives a warning)?
Fixed in Trunk: please note that pow<2, __int64> returns double, the "fixed" version performs calculations at double precision internally as well. These aren't intended as *integer* routines if that's what you're looking for... HTH, John.

John Maddock
Not sure if this zero warning policy is in effect, but if so maybe Boost can have a look at use of __int64 and pow (e.g. boost::math::pow<2, __int64> gives a warning)?
Fixed in Trunk: please note that pow<2, __int64> returns double, the "fixed" version performs calculations at double precision internally as well. These aren't intended as *integer* routines if that's what you're looking for...
HTH, John.
Thx. We had that discussion here, that returning an integer would be more precise / faster, until somebody noticed that (32 bit) integers overflow very fast. So it is ok that integers are 'promoted' to double. Btw nice addition this function. I think it's twice as fast as using std::pow using VStudio 2008.
participants (3)
-
gast128
-
John Maddock
-
Paul A. Bristow