Gennadiy Rozental wrote:
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.
Would it not be useful to provide a specialisation of the comparison template for integral types? The current semantics aren't useful IMHO - they just give undocumented false test passes - so even a naive implementation which risked overflow would be an improvement. But we can actually prevent overflow - just check if |a-b| is >= the maximum value for the integer type / 100, if not use 100*|a-b|/a, if so use something like |a-b|/(a/100). Will -- Will Bryant http://carcino.gen.nz/ will@core-dev.co.nz +64 21 655 443