2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Removed missed usage of deprecated macros in Boost.Math

[SVN r81586]
This commit is contained in:
Marshall Clow
2012-11-27 14:19:45 +00:00
parent fc112cd24f
commit 5015967f95
8 changed files with 18 additions and 18 deletions

View File

@@ -157,9 +157,9 @@ So in Boost.Math the equivalent is
geometric g05(0.5); // Probability of success = 0.5 or 50%
// Output all potentially significant digits for the type, here double.
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
int max_digits10 = 2 + (boost::math::policies::digits<double, boost::math::policies::policy<> >() * 30103UL) / 100000UL;
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined" << endl;
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined" << endl;
#else
int max_digits10 = std::numeric_limits<double>::max_digits10;
#endif

View File

@@ -82,9 +82,9 @@ int main()
// TODO find a more practical/useful example. Suggestions welcome?
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
int max_digits10 = 2 + (boost::math::policies::digits<double, boost::math::policies::policy<> >() * 30103UL) / 100000UL;
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined" << endl;
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined" << endl;
#else
int max_digits10 = std::numeric_limits<double>::max_digits10;
#endif

View File

@@ -32,9 +32,9 @@ int main()
cout << "Example using Inverse Gamma distribution. " << endl;
// TODO - awaiting a real example using Bayesian statistics.
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
int max_digits10 = 2 + (boost::math::policies::digits<double, boost::math::policies::policy<> >() * 30103UL) / 100000UL;
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined" << endl;
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined" << endl;
#else
int max_digits10 = std::numeric_limits<double>::max_digits10;
#endif

View File

@@ -28,9 +28,9 @@ int main()
{
cout << "Example 1 using Inverse Gamma function. " << endl;
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
int max_digits10 = 2 + (boost::math::policies::digits<double, boost::math::policies::policy<> >() * 30103UL) / 100000UL;
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined" << endl;
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined" << endl;
#else
int max_digits10 = std::numeric_limits<double>::max_digits10;
#endif

View File

@@ -191,8 +191,8 @@ int main ()
// Example varying the width and position of the nonfinite representations.
// With the nonfinite_num_put and _get facets, the width of the output is constant.
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined, so no max_digits10 available." << endl;
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined, so no max_digits10 available." << endl;
std::streamsize max_digits10 = 2 + std::numeric_limits<double>::digits * 30103UL / 100000UL;
#else
// Can use new C++0X max_digits10 (the maximum potentially significant digits).

View File

@@ -54,7 +54,7 @@ static const char sep = ','; // Separator of bracketed float and double values.
// Use max_digits10 (or equivalent) to obtain
// all potentially significant decimal digits for the floating-point types.
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
std::streamsize max_digits10_float = 2 + std::numeric_limits<float>::digits * 30103UL / 100000UL;
std::streamsize max_digits10_double = 2 + std::numeric_limits<double>::digits * 30103UL / 100000UL;
#else
@@ -186,8 +186,8 @@ int main ()
return 0;
}
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined, so no max_digits10 available either:"
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined, so no max_digits10 available either:"
"\n we'll have to calculate our own version." << endl;
#endif
std::cout << "std::numeric_limits<float>::max_digits10 is " << max_digits10_float << endl;

View File

@@ -44,7 +44,7 @@ static const char sep = ','; // Separator of bracketed float and double values.
// Use max_digits10 (or equivalent) to obtain
// all potentially significant decimal digits for the floating-point types.
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
std::streamsize max_digits10_float = 2 + std::numeric_limits<float>::digits * 30103UL / 100000UL;
std::streamsize max_digits10_double = 2 + std::numeric_limits<double>::digits * 30103UL / 100000UL;
#else
@@ -173,8 +173,8 @@ int main (void)
std::clog << std::endl
<< "Nonfinite_serialization.cpp' example program." << std::endl;
#ifdef BOOST_NO_NUMERIC_LIMITS_LOWEST
std::cout << "BOOST_NO_NUMERIC_LIMITS_LOWEST is defined, so no max_digits10 available either,"
#ifdef BOOST_NO_CXX11_NUMERIC_LIMITS
std::cout << "BOOST_NO_CXX11_NUMERIC_LIMITS is defined, so no max_digits10 available either,"
"using our own version instead." << std::endl;
#endif
std::cout << "std::numeric_limits<float>::max_digits10 is " << max_digits10_float << std::endl;

View File

@@ -148,7 +148,7 @@ public:
BOOST_STATIC_CONSTANT(int, digits = limits_type::digits);
BOOST_STATIC_CONSTANT(int, digits10 = limits_type::digits10);
#ifndef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
BOOST_STATIC_CONSTANT(int, max_digits10 = limits_type::max_digits10);
#endif
BOOST_STATIC_CONSTANT(bool, is_signed = limits_type::is_signed);
@@ -198,7 +198,7 @@ public:
BOOST_STATIC_CONSTANT(int, digits = limits_type::digits);
BOOST_STATIC_CONSTANT(int, digits10 = limits_type::digits10);
#ifndef BOOST_NO_NUMERIC_LIMITS_LOWEST
#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
BOOST_STATIC_CONSTANT(int, max_digits10 = limits_type::max_digits10);
#endif
BOOST_STATIC_CONSTANT(bool, is_signed = limits_type::is_signed);