mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
03b910ee7f
Since all source files are now C++, this is redundant. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
17 lines
320 B
C
17 lines
320 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef SUBSURFACE_FLOAT_H
|
|
#define SUBSURFACE_FLOAT_H
|
|
|
|
#include <math.h>
|
|
|
|
static inline bool nearly_equal(double a, double b)
|
|
{
|
|
return fabs(a - b) <= 1e-6 * fmax(fabs(a), fabs(b));
|
|
}
|
|
|
|
static inline bool nearly_0(double fp)
|
|
{
|
|
return fabs(fp) <= 1e-6;
|
|
}
|
|
|
|
#endif // SUBSURFACE_FLOAT_H
|