]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/multiprecision/test/test_exp.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / multiprecision / test / test_exp.cpp
index f3eae923f45c97f86bf6e85097272a1a399cc085..53565a6a02dcf6c83deb1d3c2a4034df45cdd13b 100644 (file)
@@ -182,6 +182,28 @@ void test()
    BOOST_TEST(max_err < 20);
 
    BOOST_TEST(exp(T(0)) == 1);
+
+   if (!boost::multiprecision::is_interval_number<T>::value)
+   {
+      T bug_case = -1.05 * log((std::numeric_limits<T>::max)());
+      for (unsigned i = 0; bug_case > -20 / std::numeric_limits<T>::epsilon(); ++i, bug_case *= 1.05)
+      {
+         if (std::numeric_limits<T>::has_infinity)
+         {
+            BOOST_CHECK_EQUAL(exp(bug_case), 0);
+         }
+         else
+         {
+            BOOST_CHECK_LE(exp(bug_case), std::numeric_limits<T>::min());
+         }
+      }
+      bug_case = log((std::numeric_limits<T>::max)()) / -1.0005;
+      for (unsigned i = 0; i < 20; ++i, bug_case /= 1.05)
+      {
+         BOOST_CHECK_GE(exp(bug_case), (std::numeric_limits<T>::min)());
+      }
+   }
+
 }