mirror of
https://github.com/boostorg/functional.git
synced 2025-07-31 04:57:16 +02:00
Deal with NaN & infinity in the hash float function on Broland.
[SVN r28186]
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user