Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-07-25 10:45:09


"John Maddock" <john_at_[hidden]> wrote in message
news:000201c6b013$2968a970$8cd96b51_at_fuji...
> I'm using Boost.Test, specifically BOOST_CHECK_CLOSE with non-built-in
> floating point types. In particular I have a type "real_concept" that
> models the concepts I want an arbitrary real number type to adhere to.
> This
> type does *not* specialise std::numeric_limits: deliberately so because I
> want to support types with whose precision varies at runtime. This causes
> a
> problem inside safe_fpt_division which uses std::numeric_limits without
> the
> check to see if it's specialised or not. In turn this causes almost all
> comparisons using real_concept to succeed because safe_fpt_division will
> almost always return 0 for real_concept.
>
> The obvious fix is simply to place the numeric_limits checks inside an
> if(std::numeric_limits<FPT>::is_specialized) block, and to perform no
> safety
> checks in this case and just go ahead and perform the division regardless

Did you mean in "else" case?

> (there are no checks that can be performed in this case anyway).
>
> Thanks, John.

I will look into this later today.

Gennadiy


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