T frac = boost::math::modf(arg, &r);
check_modf_result(arg, frac, r);
- if(abs(r) < (std::numeric_limits<int>::max)())
+ if(abs(r) < static_cast<T>((std::numeric_limits<int>::max)()))
{
int i = iround(arg);
check_within_half(arg, i);
si = itrunc(static_cast<T>((std::numeric_limits<int>::min)()));
check_trunc_result(static_cast<T>((std::numeric_limits<int>::min)()), T(si));
}
- if(abs(r) < (std::numeric_limits<long>::max)())
+ if(abs(r) < static_cast<T>((std::numeric_limits<long>::max)()))
{
long l = lround(arg);
check_within_half(arg, l);
k = ltrunc(static_cast<T>((std::numeric_limits<long>::min)()));
check_trunc_result(static_cast<T>((std::numeric_limits<long>::min)()), T(k));
}
-
+
#ifdef BOOST_HAS_LONG_LONG
- if(abs(r) < (std::numeric_limits<boost::long_long_type>::max)())
+ if(abs(r) < static_cast<T>((std::numeric_limits<boost::long_long_type>::max)()))
{
boost::long_long_type ll = llround(arg);
check_within_half(arg, ll);
BOOST_CHECK_EQUAL(boost::math::round(9007199254740993.0), 9007199254740993.0);
test_round_number(9007199254740993.0);
+
+ #ifdef BOOST_HAS_LONG_LONG
+ // std::numeric_limits<long long>::max() + 1
+ BOOST_CHECK_EQUAL(boost::math::round(9223372036854775808.0), 9223372036854775808.0);
+ test_round_number(9223372036854775808.0);
+ #endif
}