Skip to content

Commit

Permalink
Merge pull request sass#2792 from mgreter/bugfix/compare-doubles-epsilon
Browse files Browse the repository at this point in the history
Fix number comparison for floats/doubles by calculations beyond 1e-10.
  • Loading branch information
mgreter authored Dec 29, 2018
2 parents 7700049 + 7223f84 commit 750a62d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Sass {

// ToDo: should this really be hardcoded
// Note: most methods follow precision option
const double NUMBER_EPSILON = 0.00000000000001;
const double NUMBER_EPSILON = 1e-12;

// macro to test if numbers are equal within a small error margin
#define NEAR_EQUAL(lhs, rhs) std::fabs(lhs - rhs) < NUMBER_EPSILON
Expand Down

0 comments on commit 750a62d

Please sign in to comment.