|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85349 - in sandbox/multiprecision.cpp_bin_float: boost/multiprecision libs/multiprecision/test
From: john_at_[hidden]
Date: 2013-08-14 11:44:43
Author: johnmaddock
Date: 2013-08-14 11:44:43 EDT (Wed, 14 Aug 2013)
New Revision: 85349
URL: http://svn.boost.org/trac/boost/changeset/85349
Log:
Tidy up code.
Add trick case tests.
Text files modified:
sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp | 5 -----
sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_log.cpp | 7 +++++++
sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_numeric_limits.cpp | 2 +-
sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_sqrt.cpp | 5 +++++
4 files changed, 13 insertions(+), 6 deletions(-)
Modified: sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp
==============================================================================
--- sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp Wed Aug 14 11:34:02 2013 (r85348)
+++ sandbox/multiprecision.cpp_bin_float/boost/multiprecision/cpp_bin_float.hpp 2013-08-14 11:44:43 EDT (Wed, 14 Aug 2013) (r85349)
@@ -939,11 +939,6 @@
res = std::numeric_limits<number<cpp_bin_float<bits> > >::quiet_NaN().backend();
return;
}
- if(arg.exponent() > cpp_bin_float<bits>::max_exponent)
- {
- res = arg;
- return;
- }
if(arg.sign())
{
res = std::numeric_limits<number<cpp_bin_float<bits> > >::quiet_NaN().backend();
Modified: sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_log.cpp
==============================================================================
--- sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_log.cpp Wed Aug 14 11:34:02 2013 (r85348)
+++ sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_log.cpp 2013-08-14 11:44:43 EDT (Wed, 14 Aug 2013) (r85349)
@@ -206,6 +206,13 @@
BOOST_TEST(max_err < 10);
#endif
BOOST_TEST(log(T(1)) == 0);
+ //
+ // Some tricky special cases:
+ //
+ BOOST_CHECK((boost::math::isfinite)(log((std::numeric_limits<T>::max)())));
+ BOOST_CHECK((boost::math::isfinite)(log((std::numeric_limits<T>::min)())));
+ BOOST_CHECK((boost::math::isfinite)(log10((std::numeric_limits<T>::max)())));
+ BOOST_CHECK((boost::math::isfinite)(log10((std::numeric_limits<T>::min)())));
}
Modified: sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_numeric_limits.cpp
==============================================================================
--- sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_numeric_limits.cpp Wed Aug 14 11:34:02 2013 (r85348)
+++ sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_numeric_limits.cpp 2013-08-14 11:44:43 EDT (Wed, 14 Aug 2013) (r85349)
@@ -23,7 +23,7 @@
# define TEST_TOMMATH
# define TEST_CPP_INT
# define TEST_MPFI_50
-//# define TEST_FLOAT128
+# define TEST_FLOAT128
# define TEST_CPP_BIN_FLOAT
#ifdef _MSC_VER
Modified: sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_sqrt.cpp
==============================================================================
--- sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_sqrt.cpp Wed Aug 14 11:34:02 2013 (r85348)
+++ sandbox/multiprecision.cpp_bin_float/libs/multiprecision/test/test_sqrt.cpp 2013-08-14 11:44:43 EDT (Wed, 14 Aug 2013) (r85349)
@@ -183,6 +183,11 @@
#else
BOOST_TEST(max_err < 20);
#endif
+ //
+ // Some tricky special cases:
+ //
+ BOOST_CHECK((boost::math::isfinite)(sqrt((std::numeric_limits<T>::max)())));
+ BOOST_CHECK((boost::math::isfinite)(sqrt((std::numeric_limits<T>::min)())));
}
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