]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/math/test/test_round.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / math / test / test_round.cpp
index 6475ac295a90a8c42384b1dd6c4b75e9e7914702..95ff4d234e974e566f11f70a10bbbc3a577a2667 100644 (file)
@@ -139,7 +139,7 @@ void test_round_number(T arg)
    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);
@@ -159,7 +159,7 @@ void test_round_number(T arg)
       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);
@@ -179,9 +179,9 @@ void test_round_number(T arg)
       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);
@@ -464,4 +464,10 @@ BOOST_AUTO_TEST_CASE( test_main )
 
    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
 }