diff --git a/include/boost/multiprecision/detail/functions/pow.hpp b/include/boost/multiprecision/detail/functions/pow.hpp index 7ecee5db..593ed227 100644 --- a/include/boost/multiprecision/detail/functions/pow.hpp +++ b/include/boost/multiprecision/detail/functions/pow.hpp @@ -518,9 +518,6 @@ inline void eval_pow(T& result, const T& x, const T& a) case FP_ZERO: switch (fpc_a) { - case FP_ZERO: - result = si_type(1); - break; case FP_NAN: result = a; break; diff --git a/test/test_pow.cpp b/test/test_pow.cpp index 56f6d0d0..8c838733 100644 --- a/test/test_pow.cpp +++ b/test/test_pow.cpp @@ -159,6 +159,18 @@ void test_issue722() BOOST_CHECK((boost::multiprecision::isnan)(pow_neg_inf_to_the_nan)); } + + for (int index = 0; index < 8; ++index) + { + static_cast(index); + + const T val_x_zero { ::my_zero() * dist(gen) }; + const T val_a_zero { ::my_zero() * dist(gen) }; + + const T pow_zero_to_the_zero = pow(val_x_zero, val_a_zero); + + BOOST_CHECK(pow_zero_to_the_zero == 1); + } } }