|
Boost : |
From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-12-06 13:50:47
rogeeff wrote:
>
> --- In boost_at_y..., Ullrich Koethe <u.koethe_at_c...> wrote:
> > rogeeff wrote:
> > * 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?
>
> 1 and 2 are the number of arithmetic operation. See second form of
> marcos.
>
Ah, the two forms are only distinguished by the parameter type. I'm
wondering whether this might be dangerous (i.e. someone means '2' steps,
but writes '2.0' steps - this would lead to a false sence of security).
Is it guaranteed by the standard that
n * std::numeric_limits<FPT>::epsilon() / 2.0 != 0.0 ?
Otherwise, you should use
std::max(n * std::numeric_limits<FPT>::epsilon() / 2.0,
std::numeric_limits<FPT>::epsilon());
or perhaps
n * std::numeric_limits<FPT>::epsilon()
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