Boost logo

Boost :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2005-04-18 09:56:54


At Monday 2005-04-18 03:52, you wrote:
>Currently "functional/hash - hash_float_test" fails on Tru64/CXX6.5 (See
>http://tinyurl.com/8opfo)
>
>The reason of the failure is that QNaN and 0 give the same hash code on
>this platform. I was wondering what the expected hash of QNAN actually
>should be. Is it some platform dependent value?

Am I missing something here? Since it is obvious that one canNOT generate
a unique hash for all possible inputs, why should there necessarily be a
difference between any 2?

>I put some traces in hash_detail::float_hash_value(), and the cause for
>the same hash value for 0 and QNAN seems to be that static_cast<int>(QNAN)
>gives 0 which then results in a call of hash_combine(0, 0) for both 0 and QNAN.
>
>Does anybody know what the expected result of static_cast<int>(QNAN) is?
>My guess is that either I should get a floating point exception for this
>expression or that the return value is unspecified and errno is set to
>[EDOM], but this is pure speculation on my side.
>
>Markus
>
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk