Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-12-06 13:08:30


rogeeff wrote:
>
> >
> > [As an aside: it would be really helpful for testing if there were
> some
> > support for determining the right tolerance for floating point
> > comparisons automatically on every platform, depending on the
> expected
> > error of the computation. Would this be part of your module?]
>
> This is already in place.

Ah sorry, I hadn't seen this new page in the docu. Now I see that the
float comparison code can really be refactored into a separate header,
so that it can be used in other contexts than testing

Some remarks:

* an output "[1 != 1 (1e-08)]" isn't very helpful. You should control
the output precision of the floats so that the difference can be seen
(in the example "[1.00000001 != 1.00000002 (1e-08)]")
* there are a few errors in the examples (e.g. e-11 instead of e-10)
* also in the examples: what does "1 /* really 2 */ " mean? Why does the
resulting error message say that the tolerance was 1e-05 when it
actually was 1?
* are enough compilers supporting numeric_limits to require its
existence?

* you should document more clearly your modification of Knuth's
algorithm. What are you doing differently, why was this necessary and
why does it work? (This is hard to guess from the code).

Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

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