This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tr1::unordered_set<double> bizarre rounding behavior (x86)


Michael Veksler wrote:

>   std::tr1::hash<dobule> is implemented in a very bad way.
>   it casts double to size_t, which of course does a very poor job on big
>   values (is the result of 1.0e100 cast to size_t defined ?).
>  
>
A possible solution would be using frexp & co to extract the mantissa
and then work on it, one way or the other. You can find it proposed
around. Then, often the exponent is simply discarded.

What do you think?

In case, please add your comments to the audit trail of 21193. I mean to
work pretty soon on improving those hash functions.

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]