From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-07-25 10:45:09
"John Maddock" <john_at_[hidden]> wrote in message
> 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.
> type does *not* specialise std::numeric_limits: deliberately so because I
> want to support types with whose precision varies at runtime. This causes
> problem inside safe_fpt_division which uses std::numeric_limits without
> 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
> 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.