diff options
Diffstat (limited to 'boost/math/special_functions/expm1.hpp')
-rw-r--r-- | boost/math/special_functions/expm1.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/boost/math/special_functions/expm1.hpp b/boost/math/special_functions/expm1.hpp index 7423dc5c81..9cecc89756 100644 --- a/boost/math/special_functions/expm1.hpp +++ b/boost/math/special_functions/expm1.hpp @@ -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>()) |