|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83598 - trunk/libs/math/test
From: pbristow_at_[hidden]
Date: 2013-03-27 07:52:18
Author: pbristow
Date: 2013-03-27 07:52:17 EDT (Wed, 27 Mar 2013)
New Revision: 83598
URL: http://svn.boost.org/trac/boost/changeset/83598
Log:
Revised zztest_max_digits10 test to check on RaspberryPI failures in constants_eg1.cpp.
Text files modified:
trunk/libs/math/test/zztest_max_digits10.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Modified: trunk/libs/math/test/zztest_max_digits10.cpp
==============================================================================
--- trunk/libs/math/test/zztest_max_digits10.cpp (original)
+++ trunk/libs/math/test/zztest_max_digits10.cpp 2013-03-27 07:52:17 EDT (Wed, 27 Mar 2013)
@@ -46,13 +46,18 @@
int digits10 = std::numeric_limits<double>::digits10;
std::cout << "std::numeric_limits<double>::digits10 = " << digits10 << std::endl;
-//#ifndef BOOST_NO_NUMERIC_LIMITS_LOWEST
-
#ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
+ // OK to use C++11 max_digits10;
int max_digits10 = std::numeric_limits<double>::max_digits10;
std::cout << "std::numeric_limits<double>::max_digits10 = " << max_digits10 << std::endl;
+#else
+ // No support for max_digits10; so use Kahan formula instead.
+ int max_digits10 = 2 + std::numeric_limits<double>::digits * 3010/10000;
+ std::cout << "2 + std::numeric_limits<double>::digits * 3010/10000; = " <<
+ 2 + std::numeric_limits<double>::digits * 3010/10000;
#endif
+
} // int main()
/*
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