Index: boost/test/floating_point_comparison.hpp =================================================================== --- boost/test/floating_point_comparison.hpp (revision 49449) +++ boost/test/floating_point_comparison.hpp (working copy) @@ -79,17 +79,26 @@ safe_fpt_division( FPT f1, FPT f2 ) { // Avoid overflow. - if( f2 < static_cast(1) && f1 > f2*fpt_limits::max_value() ) + if( (f2 < static_cast(1)) && (f1 > f2*fpt_limits::max_value()) ) return fpt_limits::max_value(); // Avoid underflow. - if( f1 == static_cast(0) || - f2 > static_cast(1) && f1 < f2*fpt_limits::min_value() ) + if( (f1 == static_cast(0)) || + ((f2 > static_cast(1)) && (f1 < f2*fpt_limits::min_value())) ) return static_cast(0); return f1/f2; }