|
Boost : |
From: Paul A. Bristow (boost_at_[hidden])
Date: 2003-10-29 14:23:01
Personally I would prefer a fraction to a percentage.
New names for this MACRO(s)?
BOOST_CHECK_CLOSE_RELATIVE(real1, real2, fraction) (real1 - real2) / real1 <
fraction
and
BOOST_CHECK_CLOSE_ABSOLUTE(real1, real2, difference) (real1 - real2) <
difference
perhaps
Paul
Paul A Bristow, Prizet Farmhouse, Kendal, Cumbria, LA8 8AB UK
+44 1539 561830 Mobile +44 7714 33 02 04
mailto:pbristow_at_[hidden]
| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]]On Behalf Of Gennadiy Rozental
| Sent: Tuesday, October 28, 2003 8:51 AM
| To: boost_at_[hidden]
| Subject: [boost] BOOST_CHECK_CLOSE plans
|
|
| Hi,
|
| I have several outstanding issues with BOOST_CHECK_CLOSE. Users keeps
| confuse it with absolute comparison and error message is misleading.
| What I plan is to switch to percentage based specification of the
| tolerance. IOW BOOST_CHECK_CLOSE( a, b, p ) will check that (a-b)/a does not
| exceed p percent. Error message I will change accordingly.
|
| The only problem is that will not be backward compatible. Does anybody see
| a solution to overcome this?
|
| Gennadiy.
|
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk