]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/test/test_gamma.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / math / test / test_gamma.hpp
index e94d3b9a05de4ec18e2f935a012f6393a1876f99..4ac35b5df86a1827ff2a7565a44892d01e09585c 100644 (file)
@@ -333,5 +333,17 @@ void test_spots(T, const char* name)
       BOOST_CHECK_CLOSE(::boost::math::lgamma(ldexp(static_cast<T>(11103367432951928LL), 62)), static_cast<T>(4.0411767712186990905102512019058204792570873633363159e36L), tolerance);
       BOOST_CHECK_CLOSE(::boost::math::lgamma(ldexp(static_cast<T>(11103367432951928LL), 326)), static_cast<T>(3.9754720509185529233002820161357111676582583112671658e116L), tolerance);
    }
+   //
+   // Super small values may cause spurious overflow:
+   //
+   if (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::has_denorm)
+   {
+      T value = (std::numeric_limits<T>::min)();
+      while (value != 0)
+      {
+         BOOST_CHECK((boost::math::isfinite)(boost::math::lgamma(value)));
+         value /= 2;
+      }
+   }
 }