mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 14:04:27 +02:00
Merge from trunk.
- Add `quick_erase` for unordered. `erase_return_void` is now deprecated. Fixes #3966 - Avoid collision between 0 and 0.5. Fixes #4038 [SVN r60980]
This commit is contained in:
@@ -79,6 +79,11 @@ void float_tests(char const* name, T* = 0)
|
||||
BOOST_TEST(x1(minus_zero) == HASH_NAMESPACE::hash_value(minus_zero));
|
||||
#endif
|
||||
|
||||
BOOST_TEST(x1(zero) != x1(0.5));
|
||||
BOOST_TEST(x1(minus_zero) != x1(0.5));
|
||||
BOOST_TEST(x1(0.5) != x1(-0.5));
|
||||
BOOST_TEST(x1(1) != x1(-1));
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Doing anything with infinity causes borland to crash.
|
||||
@@ -176,6 +181,12 @@ void float_tests(char const* name, T* = 0)
|
||||
BOOST_TEST(half_max != three_quarter_max);
|
||||
BOOST_TEST(quarter_max != three_quarter_max);
|
||||
|
||||
BOOST_TEST(max != -max);
|
||||
BOOST_TEST(half_max != -half_max);
|
||||
BOOST_TEST(quarter_max != -quarter_max);
|
||||
BOOST_TEST(three_quarter_max != -three_quarter_max);
|
||||
|
||||
|
||||
#if defined(TEST_EXTENSIONS)
|
||||
BOOST_TEST(x1(max) == HASH_NAMESPACE::hash_value(max));
|
||||
BOOST_TEST(x1(half_max) == HASH_NAMESPACE::hash_value(half_max));
|
||||
@@ -197,6 +208,12 @@ void float_tests(char const* name, T* = 0)
|
||||
BOOST_TEST(x1(half_max) != x1(three_quarter_max));
|
||||
BOOST_TEST(x1(three_quarter_max) == x1(three_quarter_max));
|
||||
|
||||
BOOST_TEST(x1(max) != x1(-max));
|
||||
BOOST_TEST(x1(half_max) != x1(-half_max));
|
||||
BOOST_TEST(x1(quarter_max) != x1(-quarter_max));
|
||||
BOOST_TEST(x1(three_quarter_max) != x1(-three_quarter_max));
|
||||
|
||||
|
||||
// Intel with gcc stdlib sometimes segfaults on calls to asin and acos.
|
||||
#if !((defined(__INTEL_COMPILER) || defined(__ICL) || \
|
||||
defined(__ICC) || defined(__ECC)) && \
|
||||
|
@@ -51,17 +51,15 @@ namespace boost
|
||||
limits<T>::min_exponent;
|
||||
}
|
||||
|
||||
// The result of frexp is always between 0.5 and 1, so its
|
||||
// top bit will always be 1. Subtract by 0.5 to remove that.
|
||||
v -= T(0.5);
|
||||
v = ldexp(v, limits<std::size_t>::digits + 1);
|
||||
v = ldexp(v, limits<std::size_t>::digits);
|
||||
std::size_t seed = static_cast<std::size_t>(v);
|
||||
v -= seed;
|
||||
|
||||
// ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
|
||||
std::size_t const length
|
||||
= (limits<T>::digits *
|
||||
boost::static_log2<limits<T>::radix>::value - 1)
|
||||
boost::static_log2<limits<T>::radix>::value
|
||||
+ limits<std::size_t>::digits - 1)
|
||||
/ limits<std::size_t>::digits;
|
||||
|
||||
for(std::size_t i = 0; i != length; ++i)
|
||||
|
Reference in New Issue
Block a user