OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
equals_within.h
Go to the documentation of this file.
1#pragma once
2
3#include <cmath>
4#include "utils_export.h"
5
6namespace Utils
7{
8 template<class R>
9 bool equals_within(const R a, const R b, const R epsilon = 0.001f)
10 {
11 return std::abs(a - b) < epsilon;
12 }
13
14 UTILS_EXPORT bool float_equals(float a, float b, float epsilon = 0.001f);
15
16 UTILS_EXPORT bool double_equals(double a, double b, double epsilon = 0.001);
17}
bool float_equals(float a, float b, float epsilon)
bool double_equals(double a, double b, double epsilon)
bool equals_within(const R a, const R b, const R epsilon=0.001f)
#define UTILS_EXPORT