13 lines
330 B
C++
Executable File
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 */
|