8 template <
typename T,
typename U>
9 inline bool within_tolerance(T a, U tolerance) {
10 return std::abs(a) <= tolerance;
15 typename std::enable_if_t<!std::numeric_limits<T>::is_integer,
int> = 0>
16 constexpr
bool almost_equal(T x, T y,
size_t ulp) {
18 const auto abs_diff = std::abs(x - y);
20 std::numeric_limits<T>::epsilon() * std::abs(x + y) * ulp ||
21 abs_diff < std::numeric_limits<T>::min();
25 inline bool nearby(
const T& a,
const T& b,
double dist) {
26 return glm::distance(a, b) <= dist;
Definition: capsule_base.h:9