What do I gain (I guess in terms of type safety, performance and accuracy) by using Boost Numeric Constants, such as pi<T>
, defined in <boost/math/constants/constants.hpp>
instead of including <cmath>
and instead using M_PI
, other than a warmer computer during compilation :)?
Type saftey and greater precision.
"All the constants are accurate to at least the 34 decimal digits required for 128-bit long doubles, and most are accurate to 100 digits or more when used with a suitable arbitrary precision type."
http://www.boost.org/doc/libs/1_49_0/boost/math/constants/constants.hpp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With