util: Add is_close function

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2021-06-23 16:13:58 +02:00
parent 5279993f4b
commit 61c143a0c8

View file

@ -181,6 +181,12 @@ namespace streamfx::util {
&& (target < (value + std::numeric_limits<T>::epsilon()));
}
template<typename T>
inline bool is_close(T target, T value, T delta)
{
return (target > (value - delta)) && (target < (value + delta));
}
template<typename T>
inline std::vector<T> pascal_triangle(size_t n)
{