mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
In our floating point comparison 0.0 should be equal to 0.0
We when comparing floating points we do a relative comparison of the difference. This fails when both numbers are (exactly) 0.0 which happens to occur when plotting an O2 graph without o2 data resulting in both min and max for the y-axis to be 0. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
bf14d31804
commit
79d5a41182
1 changed files with 1 additions and 1 deletions
2
dive.h
2
dive.h
|
@ -22,7 +22,7 @@
|
|||
(void) (&_max1 == &_max2); \
|
||||
_max1 > _max2 ? _max1 : _max2; })
|
||||
|
||||
#define IS_FP_SAME(_a, _b) (fabs((_a) - (_b)) < 0.000001 * MAX(fabs(_a), fabs(_b)))
|
||||
#define IS_FP_SAME(_a, _b) (fabs((_a) - (_b)) <= 0.000001 * MAX(fabs(_a), fabs(_b)))
|
||||
|
||||
static inline int same_string(const char *a, const char *b)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue