
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of John Maddock Sent: 16 May 2007 09:56 To: boost@lists.boost.org Subject: Re: [boost] [test] comparing floating point values
Gennadiy Rozental wrote:
No it failed, when I expected it to pass, however I don't have the test case to hand any more so maybe I misread the error messages?
Why do you expect two infinity values to be close with any tolerance?
Interesting question: if the too values are the same, then I would have expected BOOST_CHECK_CLOSE to pass. But then we get into philisophical discussions about whether two infinities are really the same :-)
Well we certainly don't want any philosophical discussions :-)) In BOOST_CHECK we are really comparing two bit patterns - both of which are std::numeric_limits<T>::infinity() and will presumably pass a BOOST_CHECK_EQUAL test, so I also would expect a BOOST_CHECK_CLOSE pass, whatever the tolerance. But most important is to try to agree and to document our conclusion? Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com