Rename hash_detail::float_limits => hash_detail::limits, since it's also used

for integers in the tests.


[SVN r35559]
This commit is contained in:
Daniel James
2006-10-11 18:58:40 +00:00
parent c2d8b6c92e
commit 3ebd297644
3 changed files with 52 additions and 52 deletions
@@ -47,11 +47,11 @@ namespace boost
namespace hash_detail
{
template <class T>
struct float_limits : std::numeric_limits<T> {};
struct limits : std::numeric_limits<T> {};
#if defined(__OpenBSD__)
template <>
struct float_limits<long double>
struct limits<long double>
: std::numeric_limits<long double>
{
static long double epsilon() {
@@ -96,19 +96,19 @@ namespace boost
//BOOST_ASSERT(0 <= v && v < 0.5);
v = boost::hash_detail::call_ldexp(v,
float_limits<std::size_t>::digits + 1);
limits<std::size_t>::digits + 1);
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
= (float_limits<T>::digits *
boost::static_log2<float_limits<T>::radix>::value - 1)
/ float_limits<std::size_t>::digits;
= (limits<T>::digits *
boost::static_log2<limits<T>::radix>::value - 1)
/ limits<std::size_t>::digits;
for(std::size_t i = 0; i < length; ++i)
{
v = boost::hash_detail::call_ldexp(v, float_limits<std::size_t>::digits);
v = boost::hash_detail::call_ldexp(v, limits<std::size_t>::digits);
std::size_t part = static_cast<std::size_t>(v);
v -= part;
hash_float_combine(seed, part);