2
0
mirror of https://github.com/boostorg/math.git synced 2026-02-25 04:22:15 +00:00

Fix gcc -fno-exception build.

This commit is contained in:
jzmaddock
2022-11-26 09:20:37 +00:00
parent c6fccc286e
commit ea70672db7
2 changed files with 8 additions and 0 deletions

View File

@@ -633,14 +633,18 @@ T ibeta_inv_imp(T a, T b, T p, T q, const Policy& pol, T* py)
T bet = 0;
if (b < 2)
{
#ifndef BOOST_NO_EXCEPTIONS
try
#endif
{
bet = boost::math::beta(a, b, pol);
}
#ifndef BOOST_NO_EXCEPTIONS
catch (const std::overflow_error&)
{
bet = tools::max_value<T>();
}
#endif
}
if(bet != 0)
{

View File

@@ -543,15 +543,19 @@ namespace detail {
last_f0 = f0;
delta2 = delta1;
delta1 = delta;
#ifndef BOOST_NO_EXCEPTIONS
try
#endif
{
detail::unpack_tuple(f(result), f0, f1, f2);
}
#ifndef BOOST_NO_EXCEPTIONS
catch (const std::overflow_error&)
{
f0 = max > 0 ? tools::max_value<T>() : -tools::min_value<T>();
f1 = f2 = 0;
}
#endif
--count;
BOOST_MATH_INSTRUMENT_VARIABLE(f0);