// Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // (C) Copyright 2007 Anthony Williams #include "fixed.hpp" #include #include #include bool valuesAreWithinEpsilon(double t,double u,double epsilon) { double const maxValue=std::max(t,u); double const minValue=std::min(t,u); epsilon=abs(epsilon); bool const res=(maxValue>=0 && (maxValue-epsilon)<=minValue) || (minValue<=0 && (minValue+epsilon)>=maxValue); if(!res) { std::cout<<"assertion failed (a==b), a="<