mirror of
https://github.com/boostorg/functional.git
synced 2025-08-02 05:54:29 +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>
|
template <class T>
|
||||||
inline std::size_t float_hash_value(T v)
|
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;
|
int exp;
|
||||||
v = boost::hash_detail::call_frexp(v, &exp);
|
v = boost::hash_detail::call_frexp(v, &exp);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user