|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r76820 - trunk/boost/math/constants
From: pbristow_at_[hidden]
Date: 2012-02-01 07:32:23
Author: pbristow
Date: 2012-02-01 07:32:22 EST (Wed, 01 Feb 2012)
New Revision: 76820
URL: http://svn.boost.org/trac/boost/changeset/76820
Log:
Added tests for new constants two_div_pi and root_two_div_pi
Text files modified:
trunk/boost/math/constants/calculate_constants.hpp | 16 ++++++++++++++++
trunk/boost/math/constants/constants.hpp | 5 +++++
2 files changed, 21 insertions(+), 0 deletions(-)
Modified: trunk/boost/math/constants/calculate_constants.hpp
==============================================================================
--- trunk/boost/math/constants/calculate_constants.hpp (original)
+++ trunk/boost/math/constants/calculate_constants.hpp 2012-02-01 07:32:22 EST (Wed, 01 Feb 2012)
@@ -74,6 +74,20 @@
return 2 * pi<T, policies::policy<policies::digits2<N> > >();
}
+template <class T> // 2 / pi
+template<int N>
+inline T constant_two_div_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return 2 / pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T> // sqrt(2/pi)
+template <int N>
+inline T constant_root_two_div_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
+{
+ return sqrt((2 / pi<T, policies::policy<policies::digits2<N> > >()));
+}
+
template <class T>
template<int N>
inline T constant_one_div_two_pi<T>::compute(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpl::int_<N>))
@@ -932,6 +946,8 @@
);
}
+
+
}}}} // namespaces
#endif // BOOST_MATH_CALCULATE_CONSTANTS_CONSTANTS_INCLUDED
Modified: trunk/boost/math/constants/constants.hpp
==============================================================================
--- trunk/boost/math/constants/constants.hpp (original)
+++ trunk/boost/math/constants/constants.hpp 2012-02-01 07:32:22 EST (Wed, 01 Feb 2012)
@@ -271,6 +271,11 @@
BOOST_DEFINE_MATH_CONSTANT(rayleigh_skewness, 6.311106578189371381918993515442277798e-01, "6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264e-01");
BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis, 3.245089300687638062848660410619754415e+00, "3.24508930068763806284866041061975441541706673178920936177133764493367904540874159051490619368679348977426462633e+00");
BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis_excess, 2.450893006876380628486604106197544154e-01, "2.45089300687638062848660410619754415417066731789209361771337644933679045408741590514906193686793489774264626328e-01");
+
+ BOOST_DEFINE_MATH_CONSTANT(two_div_pi, 6.366197723675813430755350534900574481e-01, "6.36619772367581343075535053490057448137838582961825794990669376235587190536906140360455211065012343824291370907e-01");
+ BOOST_DEFINE_MATH_CONSTANT(root_two_div_pi, 7.978845608028653558798921198687637369e-01, "7.97884560802865355879892119868763736951717262329869315331851659341315851798603677002504667814613872860605117725e-01");
+
+
} // namespace constants
} // namespace math
} // namespace boost
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk