Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost Numeric Constants Pros

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 :)?

like image 774
Nordlöw Avatar asked Nov 05 '22 00:11

Nordlöw


1 Answers

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

like image 84
Drew Avatar answered Nov 09 '22 04:11

Drew