Deal with NaN & infinity in the hash float function on Broland.

[SVN r28186]
This commit is contained in:
Daniel James
2005-04-12 20:23:09 +00:00
parent a2cec1b71c
commit b1def5cf1d

View File

@ -220,6 +220,15 @@ namespace boost
template <class T>
inline std::size_t float_hash_value(T v)
{
#if defined(__BORLAND__)
if(v == std::numeric_limits<double>::quiet_NaN())
return 0;
if(v == std::numeric_limits<double>::infinity())
return 1;
if(v == -std::numeric_limits<double>::infinity())
return 2;
#endif
int exp;
v = boost::hash_detail::call_frexp(v, &exp);