Imported Upstream version 1.64.0
[platform/upstream/boost.git] / boost / math / special_functions / expm1.hpp
index 7423dc5..9cecc89 100644 (file)
@@ -107,6 +107,10 @@ T expm1_imp(T x, const mpl::int_<0>&, const Policy& pol)
    BOOST_MATH_STD_USING
 
    T a = fabs(x);
+   if((boost::math::isnan)(a))
+   {
+      return policies::raise_domain_error<T>("boost::math::expm1<%1%>(%1%)", "expm1 requires a finite argument, but got %1%", a, pol);
+   }
    if(a > T(0.5f))
    {
       if(a >= tools::log_max_value<T>())