Files
karl/include/simulation/compare.h
T
2024-12-04 17:15:04 +01:00

13 lines
330 B
C++
Executable File

#ifndef COMPARE_H
#define COMPARE_H
#include "constants/sim_constants.h"
// check if a and b are the same up to an accuracy eps defined in constants/sim_constants.h
// isEqual(a,b) = true <=> abs(a - b) < eps
bool isEqual(double a, double b) {
return std::abs(a - b) < SimConstants::compare_epsilon;
}
#endif /* COMPARE_H */