Skip to content

Commit

Permalink
Fix max==min float comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Nov 27, 2024
1 parent 512e4fd commit b8f8dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gfx/pal_packing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <algorithm>
#include <deque>
#include <inttypes.h>
#include <math.h>
#include <optional>
#include <queue>
#include <type_traits>
Expand Down Expand Up @@ -485,7 +486,8 @@ std::tuple<DefaultInitVec<size_t>, size_t>
maxSize,
maxRelSize
);
if (minSize * maxRelSize - maxSize * minRelSize < minRelSize * maxRelSize * .001) {
if (fabs(minSize * maxRelSize - maxSize * minRelSize)
< fabs(minRelSize * maxRelSize) * .001) {
options.verbosePrint(
Options::VERB_TRACE,
" All efficiencies are identical\n"
Expand Down
Binary file modified test/gfx/color_curve.out.pal
Binary file not shown.

0 comments on commit b8f8dbd

Please sign in to comment.