File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 44#include " ../Helpers/StringConverter.h"
55#endif // ifndef BUILD_NO_DEBUG
66
7-
87#include < Arduino.h>
98// Need to include Arduino.h first, then cmath
109// See: https://github.com/esp8266/Arduino/issues/8922#issuecomment-1542301697
1110#include < cmath>
1211
1312#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
14- constexpr double ESPEASY_DOUBLE_EPSILON = ESPEASY_DOUBLE_EPSILON_FACTOR * std::numeric_limits<double >::epsilon();
15- constexpr double ESPEASY_DOUBLE_EPSILON_NEG = -1.0 * ESPEASY_DOUBLE_EPSILON_FACTOR * std::numeric_limits<double >::epsilon();
13+ constexpr double ESPEASY_DOUBLE_EPSILON = ESPEASY_DOUBLE_EPSILON_FACTOR * std::numeric_limits<double >::epsilon();
14+ constexpr double ESPEASY_DOUBLE_EPSILON_NEG = -1.0 * ESPEASY_DOUBLE_EPSILON_FACTOR * std::numeric_limits<double >::epsilon();
1615#endif
17- constexpr float ESPEASY_FLOAT_EPSILON = std::numeric_limits<float >::epsilon();
18- constexpr float ESPEASY_FLOAT_EPSILON_NEG = -1 .0f * std::numeric_limits<float >::epsilon();
16+ constexpr float ESPEASY_FLOAT_EPSILON = ESPEASY_FLOAT_EPSILON_FACTOR * std::numeric_limits<float >::epsilon();
17+ constexpr float ESPEASY_FLOAT_EPSILON_NEG = -1 .0f * ESPEASY_FLOAT_EPSILON_FACTOR * std::numeric_limits<float >::epsilon();
1918
2019#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
2120int maxNrDecimals_fpType (const double & value)
Original file line number Diff line number Diff line change 66
77// Internal ESPEasy representation of double values
88#define ESPEASY_DOUBLE_NR_DECIMALS 14
9- #define ESPEASY_DOUBLE_EPSILON_FACTOR 1000
9+ #define ESPEASY_DOUBLE_EPSILON_FACTOR 2.0
1010#define ESPEASY_FLOAT_NR_DECIMALS 6
11- #define ESPEASY_FLOAT_EPSILON_FACTOR 1000
11+ #define ESPEASY_FLOAT_EPSILON_FACTOR 2.0
1212
1313#if FEATURE_USE_DOUBLE_AS_ESPEASY_RULES_FLOAT_TYPE
1414int maxNrDecimals_fpType (const double & value );
You can’t perform that action at this time.
0 commit comments