Is this the best way to check if two floating point numbers are equal, or close to being equal?
template <class T>
bool IsEqual(T rhs, T lhs)
{
T diff = std::abs(lhs - rhs);
T epsilon = std::numeric_limits<T>::epsilon( ) * std::max(std::abs(rhs), std::abs(lhs));
return diff <= epsilon ;
}