Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-09-22 09:26:22


>>BOOST_CHECK_CLOSE algorithm involves division (it compared relative
>>distance
>>with tolerance). |a-b|/|a| will always produce 0 for integral types. Which
>>is less then any tolerance you could specify.
>>
>>
> But we're comparing it to a 0-100 percentage number, so why can't we
> just multiply before the division?

I chose to divide percent tolerance by 100 (multiplication would lead to
overflow issues). BOOST_CHECK_CLOSE doesn't really fit for integral type
closeness check. You could use BOOST_CHECK_SMALL instead.

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net