add range to f_equal

main
Brett 2025-04-02 18:33:47 -04:00
parent 8b23715ddd
commit 284743c683
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake)
set(BLT_VERSION 5.2.32)
set(BLT_VERSION 5.2.33)
set(BLT_TARGET BLT)

View File

@ -21,9 +21,9 @@ namespace blt
constexpr float EPSILON = std::numeric_limits<float>::epsilon();
static inline constexpr bool f_equal(float v1, float v2)
static constexpr bool f_equal(const float v1, const float v2, const float range = 1)
{
return v1 >= v2 - EPSILON && v1 <= v2 + EPSILON;
return v1 >= v2 - (EPSILON * range) && v1 <= v2 + (EPSILON * range);
}
template <typename T, blt::u32 size>