Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2005-04-18 05:52:04


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?

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


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