diff --git a/include/boost/math/ccmath/fmax.hpp b/include/boost/math/ccmath/fmax.hpp index fca1d7886..0eb1ecbaa 100644 --- a/include/boost/math/ccmath/fmax.hpp +++ b/include/boost/math/ccmath/fmax.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace boost::math::ccmath { @@ -59,25 +60,8 @@ constexpr auto fmax(T1 x, T2 y) noexcept { if (BOOST_MATH_IS_CONSTANT_EVALUATED(x)) { - // If the type is an integer (e.g. epsilon == 0) then set the epsilon value to 1 so that type is at a minimum - // cast to double - constexpr auto T1p = std::numeric_limits::epsilon() > 0 ? std::numeric_limits::epsilon() : 1; - constexpr auto T2p = std::numeric_limits::epsilon() > 0 ? std::numeric_limits::epsilon() : 1; - - using promoted_type = - #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS - std::conditional_t>>>; - #else - >>; - #endif - - return boost::math::ccmath::fmax(promoted_type(x), promoted_type(y)); + using promoted_type = boost::math::tools::promote_args_2_t; + return boost::math::ccmath::fmax(static_cast(x), static_cast(y)); } else {